@base             <http://w3id.org/oseg/ont/osh/core> .
@prefix osh:      <#> .
@prefix cc:       <http://creativecommons.org/ns#> .
@prefix dcterms:  <http://purl.org/dc/terms/> .
@prefix dctype:   <http://purl.org/dc/dctype/> .
@prefix dcam:     <http://purl.org/dc/dcam/> .
@prefix doap:     <http://usefulinc.com/ns/doap#> .
@prefix osegprof: <https://w3id.org/oseg/ont/oseg-profiles#> .
@prefix oshmeta:  <http://w3id.org/oseg/ont/osh/meta#> .
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema:   <http://schema.org/> .
@prefix skos:     <http://www.w3.org/2004/02/skos/core#> .
@prefix spdxt:    <http://spdx.org/rdf/terms#> .
@prefix spdxl:    <https://spdx.org/licenses/> .
@prefix vann:     <http://purl.org/vocab/vann/> .
@prefix vf:       <https://w3id.org/valueflows/ont/vf-core#> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .

<>
  a owl:Ontology ;
  owl:versionInfo "0.1" ;
  owl:versionIRI <https://w3id.org/oseg/ont/0.1/osh> ;
  dcterms:title "Open Source Hardware (OSH) ontology"@en ;
  dcterms:description "An OSH design-space and physical world ontology"@en ;
  dcterms:language <http://id.loc.gov/vocabulary/iso639-1/en> ;
  dcterms:creator osegprof:robinVobruba ;
  schema:creator osegprof:robinVobruba ;
  dcterms:publisher osegprof:osegAssociation ;
  dcterms:license "https://www.gnu.org/licenses/agpl-3.0.txt" ;
  dcterms:isVersionOf <https://w3id.org/oseg/ont/osh> ;
  cc:license "https://www.gnu.org/licenses/agpl-3.0.txt" ;
  spdxt:licenseDeclared spdxl:AGPL-3.0-or-later ;
  vann:example "https://github.com/OSEGermany/osh-ont/raw/master/src/ontology/osh-example-tractor.ttl" ; # TODO This also needs to be versioned, and optimally use a PURL too!
  vann:preferredNamespacePrefix "osh" ;
  vann:preferredNamespaceUri <https://w3id.org/oseg/ont/osh#> ; # TODO When releasing, this has to be changed (adding the version)!
  vann:usageNote "https://codeberg.org/oseg/osh-ont/src/branch/master/README.md" ;
  schema:comment '''
# SPDX-FileCopyrightText: 2023 - 2024 Robin Vobruba <hoijui.quaero@gmail.com>
#
# SPDX-License-Identifier: CC0-1.0
''' ;
  schema:comment '''Regarding the use of `schema:domainIncludes`
and `schema:rangeIncludes` in this ontology:
Looking at the definitions for the RDFS version
of the two, `rdfs:domain` and `rdfs:range`:
* https://www.w3.org/TR/rdf-schema/#ch_domain
* https://www.w3.org/TR/rdf-schema/#ch_range
and as described in this StackOverflow answer:
<https://stackoverflow.com/a/74782257/586229>,
multiple objects for the two RDFS properties mean,
that *all of them* apply, simultaneously,
not *one of them*.
You may think of this as an `AND` coupling.
We want the *one of them* meaning though (`OR`).
The `schema:*` properties give us just that.'''@en ;
  dcterms:source "https://codeberg.org/oseg/osh-ont/src/branch/master/src/ontology/osh.ttl" ;
  .



# everything is a thing (or tangible artifact)!!!
# some are indivisible, and everything else can be expressed as relationships (module, interface, part of, ...)
# In the design space, a each thing has a design or specification (is a spec. also a design, or vice versa?)

# - Interfaces can define interactions between a hardware device, software program and a user.
# - The exchange can be between software, {computer hardware, peripheral devices}, humans, and combinations of these.

# segment article item part piece specimen instance occurence component section porton chunk section 

# indivisible (= átomos (Gr.))

# put-together assemble compose join-up construct join unit 

# extend patch

# module element constituent

# # BoM vs "shopping list"

# BoM includes only your parts (and quantities, specs etc.) and the shopping list states where you're getting the materials from. e.g. shopping list may include parts from another machine that are then processed into parts that appear in your BoM.

# # Maybe interesting if we get to skills:
# http://purl.org/dc/terms/educationLevel


osh:Thing
  a owl:Class ;
  a skos:Concept ;
  owl:equivalentClass dctype:PhysicalObject ;
  rdfs:subClassOf vf:EconomicResource ;
  skos:prefLabel "Physical object"@en ;
  skos:altLabel "Physical thing"@en ;
  skos:altLabel "Thing"@en ;
  rdfs:comment "Could be a solid, a gas, a liquid, an electromagnetic wave, or a combination of any number of these in different shapes and constellations"@en ;
  oshmeta:realm oshmeta:physicalRealm ;
  .

osh:ThingSpecification
  a owl:Class ;
  a skos:Concept ;
  rdfs:subClassOf osh:Regulation ;
  rdfs:subClassOf vf:ResourceSpecification ;
  rdfs:label "Specification of Things"@en ;
  rdfs:comment "Technical Norm/Standard/Specification that specifies an osh:Thing, for example an ISO norm for screws/bolts."@en ;
  oshmeta:realm oshmeta:regulationRealm ;
  .

osh:Design
  a owl:Class ;
  a skos:Concept ;
  rdfs:subClassOf vf:EconomicResource ;
  rdfs:subClassOf osh:ThingSpecification ;
  rdfs:label "Virtual description of an osh:Thing"@en ;
  rdfs:comment "A bunch of (hopefully) well structured files describing how a thing is shaped, formed, manufactured, assembled and possibly even recycled and used."@en ;
  oshmeta:realm oshmeta:designRealm ;
  .

osh:StandardizedComponent
  a owl:Class ;
  a skos:Concept ;
  rdfs:subClassOf vf:ThingSpecification ;
  rdfs:label "Standardized Component"@en ;
  rdfs:comment "An excerpt of a Standard, representing a single, standardized component. This is kind of a sister to an osh:Design."@en ;
  skos:example "An M5 bolt of length 6cm; excerpt from ISO 12345 TODO."@en ;
  oshmeta:realm oshmeta:designRealm ; # TODO Does this make sense?
  .

osh:NaturalComponent
  a owl:Class ;
  a skos:Concept ;
  rdfs:subClassOf vf:ThingSpecification ;
  rdfs:label "Natural Component"@en ;
  rdfs:comment "A specification of a natural thing."@en ;
  skos:example "A Branch of a birch-tree, dry, with diameter of 3cm - 5cm, a length of minimum 2m, and with curvature below 20 degrees over these 2m."@en ;
  oshmeta:realm oshmeta:designRealm ; # TODO Does this make sense?
  .

osh:Software
  a owl:Class ;
  a skos:Concept ;
  owl:equivalentClass dctype:Software ;
  rdfs:subClassOf vf:EconomicResource ;
  skos:prefLabel "Software"@en ;
  oshmeta:realm oshmeta:designRealm ; # TODO This makes sense for the source, but if binary or interpreted, it would (also) be ... something else? and if so, what?
  .

osh:Regulation
  a owl:Class ;
  a skos:Concept ;
  rdfs:subClassOf dcterms:Standard ;
  rdfs:label "Regulation"@en ;
  rdfs:comment "Official, Legal or Technical Norm/Standard/Specification applicable to an osh:Thing or osh:Design"@en ;
  oshmeta:realm oshmeta:regulationRealm ;
  .

osh:Passport
  a owl:Class ;
  a skos:Concept ;
  rdfs:label "Digital Passport"@en ;
  rdfs:comment "A store of a history of snapshots of data (including meta-data) about a single physical or virtual object. Here we apply it to an osh:Thing, osh:Design or osh:Interface"@en ;
  oshmeta:realm oshmeta:metaRealm ;
  .

osh:Interface
  a owl:Class ;
  a skos:Concept ;
  rdfs:subPropertyOf doap:Specification ;
  rdfs:label "Interface" ;
  rdfs:comment "A virtual description of a shared boundary across two or more separate components. This is an abstract base class."@en ;
  rdfs:comment "NOTE As of our knowledge, there is no open way to technically define this (as of August 2023)."@en ;
  oshmeta:realm oshmeta:abstractRealm ;
  .

osh:HardwareInterface
  a osh:Interface ;
  a skos:Concept ;
  rdfs:label "Things Interface" ;
  rdfs:comment "A virtual description of a physical interface between things (osh:Thing)."@en ;
  rdfs:comment "NOTE As of our knowledge, there is no open way to technically define this (as of August 2023)."@en ;
  oshmeta:realm
    oshmeta:physicalRealm ,
    oshmeta:designRealm ;
  .

osh:UserInterface
  a osh:Interface ;
  a skos:Concept ;
  rdfs:label "User Interface" ;
  rdfs:comment "A virtual description of an interface involving at least one user (living thing) and one thing (osh:Thing)."@en ;
  rdfs:comment "NOTE As of our knowledge, there is no open way to technically define this (as of August 2023)."@en ;
  oshmeta:realm
    oshmeta:physicalRealm ,
    oshmeta:designRealm ;
  .

osh:TextileInterface
  a osh:Interface ;
  a skos:Concept ;
  rdfs:label "Textile Interface" ;
  rdfs:comment "A virtual description of an interface involving at least one textile."@en ;
  rdfs:comment "NOTE As of our knowledge, there is no open way to technically define this (as of August 2023)."@en ;
  oshmeta:realm
    oshmeta:physicalRealm ,
    oshmeta:designRealm ;
  .

osh:WetwareInterface
  a osh:Interface ;
  a skos:Concept ;
  rdfs:label "Wetware Interface" ;
  rdfs:comment "A virtual description of an interface involving at least one wetware."@en ;
  rdfs:comment "NOTE As of our knowledge, there is no open way to technically define this (as of August 2023)."@en ;
  oshmeta:realm
    oshmeta:physicalRealm ,
    oshmeta:designRealm ;
  .

osh:hasPart
  a owl:ObjectProperty ;
  a skos:Concept ;
  rdfs:subPropertyOf dcterms:hasPart ;
  rdfs:label "has part" ;
  rdfs:comment "Links a sub-part (a thing) to its enclosing thing. This is the `osh:physicalRealm` alternative to `osh:hasComponent`." ;
  schema:rangeIncludes osh:Thing ;
  schema:domainIncludes osh:Thing ;
  oshmeta:realm oshmeta:physicalRealm ;
  .

osh:hasComponent
  a owl:ObjectProperty ;
  a skos:Concept ;
  rdfs:subPropertyOf dcterms:hasPart ;
  rdfs:label "has component" ;
  rdfs:comment "Links a sub-component (a design) to its enclosing design. This is the `osh:designRealm` alternative to `osh:hasPart`." ;
  schema:rangeIncludes osh:Design ;
  schema:domainIncludes osh:Design ;
  oshmeta:realm oshmeta:designRealm ;
  .

# osh:hasInterface
#   a owl:ObjectProperty ;
#   a skos:Concept ;
#   rdfs:label "has interface" ;
#   rdfs:comment "Indicates that a design implements an osh:Interface; TODO Which side of the interface?" ;
#   schema:rangeIncludes osh:Interface ;
#   schema:domainIncludes osh:Design ;
#   oshmeta:realm oshmeta:designRealm ;
#   .

osh:featuresInterface
  a owl:ObjectProperty ;
  a skos:Concept ;
  # rdfs:subPropertyOf dcterms:references ;
  rdfs:subPropertyOf doap:implements ;
  rdfs:label "features interface" ;
  rdfs:comment "Indicates that a thing *features* an osh:Interface" ;
  schema:rangeIncludes osh:Interface ;
  schema:domainIncludes osh:Design ;
  oshmeta:realm oshmeta:designRealm ;
  .

osh:implementsInterface
  a owl:ObjectProperty ;
  a skos:Concept ;
  # rdfs:subPropertyOf dcterms:references ;
  rdfs:subPropertyOf doap:implements ;
  rdfs:label "provides interface" ;
  rdfs:comment "Indicates that a design *implements* an osh:Interface" ;
  schema:rangeIncludes osh:Interface ;
  schema:domainIncludes osh:Design ;
  oshmeta:realm oshmeta:designRealm ;
  .

osh:conformsTo
  a owl:ObjectProperty ;
  a skos:Concept ;
  rdfs:subPropertyOf dcterms:conformsTo ;
  rdfs:subPropertyOf vf:basedOn ;
  skos:prefLabel "conforms to" ;
  rdfs:comment "Indicates that a standardized component is specified by a specific osh:ThingSpecification." ;
  schema:rangeIncludes osh:ThingSpecification ;
  schema:domainIncludes osh:StandardizedComponent ;
  oshmeta:realm oshmeta:designRealm ;
  .

osh:isDefinedBy
  a owl:ObjectProperty ;
  a skos:Concept ;
  rdfs:subPropertyOf dcterms:conformsTo ;
  rdfs:subPropertyOf dcterms:source ;
  rdfs:subPropertyOf vf:basedOn ;
  rdfs:label "is defined by" ;
  rdfs:comment "Indicates that a thing is defined by/desgined in/documented in a specific osh:Design." ;
  schema:rangeIncludes osh:Design ;
  schema:domainIncludes osh:Thing ;
  oshmeta:realm oshmeta:physicalRealm ;
  .

# osh:isExample
#   a owl:ObjectProperty ;
#   a skos:Concept ;
#   rdfs:label "is example" ;
#   rdfs:comment "Indicates that something is an example instance, not to be considered actual data, but to be used for documentation purposes." ;
#   schema:rangeIncludes xsd:boolean ;
#   schema:domainIncludes
#     osh:Thing ,
#     osh:Design ,
#     osh:Regulation ,
#     osh:Passport ,
#     osh:Interface ;
#   # oshmeta:realm oshmeta:designRealm ;
#   .
