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 xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX schema: <http://schema.org/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX vann: <http://purl.org/vocab/vann/>

rr: a owl:Ontology ;
  rdfs:label "R2RML vocabulary"@en ;
  rdfs:comment "RDB to RDF Mapping Language - Vocabulary"@en ;
  dcterms:contributor <http://richard.cyganiak.de/foaf.rdf#cygri> , <http://www.w3.org/People/Ivan/> , <http://boris.villazon.terrazas.name> ;
  schema:inLanguage "en" ;
  dcterms:license <http://creativecommons.org/licenses/by/3.0/> ;
  dc:issued "2012-01-24"@en ;
  dc:modified "2012-07-16"@en ;
  dc:publisher <http://www.w3.org/> ;
  a <http://purl.org/vocommons/voaf#Vocabulary> ;
  vann:preferredNamespacePrefix "rr" ;
  vann:preferredNamespaceUri "http://www.w3.org/ns/r2rml#"^^xsd:anyURI ;
  sh:declare [
    sh:prefix "rr" ;
    sh:namespace "http://www.w3.org/ns/r2rml#"^^xsd:anyURI
  ] , [
    sh:prefix "linkml" ;
    sh:namespace "https://w3id.org/linkml/"^^xsd:anyURI
  ] , [
    sh:prefix "dc" ;
    sh:namespace "http://purl.org/dc/elements/1.1/"^^xsd:anyURI
  ] , [
    sh:prefix "rdf" ;
    sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI
  ] , [
    sh:prefix "rdfs" ;
    sh:namespace "http://www.w3.org/2000/01/rdf-schema#"^^xsd:anyURI
  ] , [
    sh:prefix "foaf" ;
    sh:namespace "http://xmlns.com/foaf/0.1/"^^xsd:anyURI
  ] .

rr:IRI a owl:Class ;
  rdfs:comment "Denotes an IRI, used with termpType."@en .

rr:GraphMap a owl:Class ;
  rdfs:comment "Represents a graph map."@en ;
  rdfs:subClassOf rr:TermMap .

rr:TriplesMap a owl:Class ;
  rdfs:comment "Represents a triples map."@en ;
  skos:editorialNote "OWL: (rr:subjectMap exactly 1 rr:SubjectMap or rr:subject exactly 1)"@en ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rr:subjectMap ;
    owl:allValuesFrom rr:SubjectMap
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:subject ;
    owl:allValuesFrom owl:Thing
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:logicalTable ;
    owl:allValuesFrom rr:LogicalTable
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:logicalTable ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] .

rr:BlankNode a owl:Class ;
  rdfs:comment "Denotes a blank node, used with termType"@en .

rr:BaseTableOrView a owl:Class ;
  rdfs:subClassOf rr:LogicalTable , [
    a owl:Restriction ;
    owl:onProperty rr:tableName ;
    owl:allValuesFrom xsd:string
  ] .

rr:Literal a owl:Class ;
  rdfs:comment "Denotes a Literal, used with termType."@en .

rr:Join a owl:Class ;
  rdfs:comment "Represents a join condition."@en ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rr:child ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:child ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:parent ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:parent ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] .

rr:ObjectMap a owl:Class ;
  rdfs:comment "Represents an object map."@en ;
  rdfs:subClassOf rr:TermMap , [
    a owl:Restriction ;
    owl:onProperty rr:datatype ;
    owl:allValuesFrom rdfs:Datatype
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:language ;
    owl:allValuesFrom xsd:string
  ] .

rr:RefObjectMap a owl:Class ;
  rdfs:comment "Denotes a reference to an object map."@en ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rr:joinCondition ;
    owl:allValuesFrom rr:Join
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:parentTriplesMap ;
    owl:allValuesFrom rr:TriplesMap
  ] .

rr:PredicateMap a owl:Class ;
  rdfs:comment "Represents a predicate map."@en ;
  rdfs:subClassOf rr:TermMap .

rr:R2RMLView a owl:Class ;
  rdfs:subClassOf rr:LogicalTable , [
    a owl:Restriction ;
    owl:onProperty rr:sqlQuery ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:sqlVersion ;
    owl:allValuesFrom owl:Thing
  ] .

rr:LogicalTable a owl:Class ;
  rdfs:comment "Represents a logical table."@en .

rr:SubjectMap a owl:Class ;
  rdfs:comment "Represents a subject map."@en ;
  rdfs:subClassOf rr:TermMap , [
    a owl:Restriction ;
    owl:onProperty rr:graphMap ;
    owl:allValuesFrom rr:GraphMap
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:class ;
    owl:allValuesFrom rdfs:Class
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:graph ;
    owl:allValuesFrom owl:Thing
  ] .

rr:PredicateObjectMap a owl:Class ;
  rdfs:comment "Represents a predicate-object map."@en ;
  skos:editorialNote "OWL: (rr:predicateMap min 1 or rr:predicate min 1)"@en , "OWL: (rr:objectMap min 1 or rr:object min 1)"@en ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rr:object ;
    owl:allValuesFrom owl:Thing
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:predicate ;
    owl:allValuesFrom rdf:Property
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:graphMap ;
    owl:allValuesFrom rr:GraphMap
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:predicateMap ;
    owl:allValuesFrom rr:PredicateMap
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:graph ;
    owl:allValuesFrom owl:Thing
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:objectMap ;
    owl:allValuesFrom [
      a owl:Class ;
      owl:unionOf ( rr:ObjectMap rr:RefObjectMap )
    ]
  ] .

rr:TermMap a owl:Class ;
  rdfs:label "Term Map"@en ;
  rdfs:comment "A function that generates an RDF term from a logical table row."@en ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty rr:constant ;
    owl:allValuesFrom owl:Thing
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:inverseExpression ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:column ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:template ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty rr:termType ;
    owl:allValuesFrom [
      a owl:Class ;
      owl:unionOf ( rr:BlankNode rr:IRI rr:Literal )
    ]
  ] .

foaf:Person a owl:Class .

foaf:Organization a owl:Class .

rr:object a owl:ObjectProperty ;
  rdfs:comment "Specifies the object for the generated triple from the logical table row."@en ;
  rdfs:domain rr:PredicateObjectMap .

rr:constant a owl:ObjectProperty ;
  rdfs:domain rr:TermMap .

rr:predicate a owl:ObjectProperty ;
  rdfs:comment "Specifies the predicate for the generated triple from the logical table row."@en ;
  rdfs:range rdf:Property ;
  rdfs:domain rr:PredicateObjectMap .

rr:graphMap a owl:ObjectProperty ;
  rdfs:comment "Specifies a GraphMap. When used with a SubjectMap element, all the RDF triples generated from a logical row will be stored in the specified named graph. Otherwise, the RDF triple generated using the (predicate, object) pair will be stored in the specified named graph."@en ;
  rdfs:range rr:GraphMap ;
  rdfs:domain [
    a owl:Class ;
    owl:unionOf ( rr:PredicateObjectMap rr:SubjectMap )
  ] .

rr:subjectMap a owl:ObjectProperty ;
  rdfs:comment "A SubjectMap element to generate a subject from a logical table row."@en ;
  rdfs:range rr:SubjectMap ;
  rdfs:domain rr:TriplesMap .

rr:predicateObjectMap a owl:ObjectProperty ;
  rdfs:comment "A PredicateObjectMap element to generate (predicate, object) pair from a logical table row."@en ;
  rdfs:range rr:PredicateObjectMap .

rr:subject a owl:ObjectProperty ;
  rdfs:comment "An IRI reference for use as subject for all the RDF triples generated from a logical table row."@en ;
  rdfs:domain rr:TriplesMap .

rr:datatype a owl:ObjectProperty ;
  rdfs:comment "Specifies the datatype of the object component for the generated triple from a logical table row."@en ;
  rdfs:range rdfs:Datatype ;
  rdfs:domain rr:ObjectMap .

rr:predicateMap a owl:ObjectProperty ;
  rdfs:comment "A PredicateMap element to generate the predicate component of the (predicate, object) pair from a logical table row."@en ;
  rdfs:range rr:PredicateMap ;
  rdfs:domain rr:PredicateObjectMap .

rr:joinCondition a owl:ObjectProperty ;
  rdfs:comment "Specifies the join condition for joining the child logical table with the parent logical table of the foreign key constraint."@en ;
  rdfs:range rr:Join ;
  rdfs:domain rr:RefObjectMap .

rr:inverseExpression a owl:DatatypeProperty ;
  rdfs:comment "An expression that allows, at query processing time, use of index-based access to the the (underlying) relational tables, instead of simply retrieving the table rows first and then applying a filter. This property is useful for retrieval based on conditions involving subject, predicate, or object generated from logical table column(s) and involves some transformation."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:TermMap .

rr:child a owl:DatatypeProperty ;
  rdfs:comment "Names a column in the child table of a join."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:Join .

rr:class a owl:ObjectProperty ;
  rdfs:comment "The subject value generated for a logical table row will be asserted as an instance of this RDFS class."@en ;
  rdfs:range rdfs:Class ;
  rdfs:domain rr:SubjectMap .

rr:graph a owl:ObjectProperty ;
  rdfs:comment "An IRI reference for use as the graph name of all triples generated with the GraphMap."@en ;
  rdfs:domain [
    a owl:Class ;
    owl:unionOf ( rr:PredicateObjectMap rr:SubjectMap )
  ] .

rr:logicalTable a owl:ObjectProperty ;
  rdfs:comment "Definition of logical table to be mapped."@en ;
  rdfs:range rr:LogicalTable ;
  rdfs:domain rr:TriplesMap .

rr:language a owl:DatatypeProperty ;
  rdfs:comment "Specified the language for the object component for the generated triple from a logical table row."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:ObjectMap .

rr:column a owl:DatatypeProperty ;
  rdfs:comment "Name of a column in the logical table. When generating RDF triples from a logical table row, value from the specified column is used as the subject, predicate, or object (based upon the specific domain)."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:TermMap .

rr:template a owl:DatatypeProperty ;
  rdfs:comment "A template (format string) to specify how to generate a value for a subject, predicate, or object, using one or more columns from a logical table row."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:TermMap .

rr:termType a owl:ObjectProperty ;
  rdfs:comment "A string indicating whether subject or object generated using the value from column name specified for rr:column should be an IRI reference, blank node, or a literal."@en ;
  rdfs:range [
    a owl:Class ;
    owl:unionOf ( rr:BlankNode rr:IRI rr:Literal )
  ] ;
  rdfs:domain rr:TermMap .

rr:sqlQuery a owl:DatatypeProperty ;
  rdfs:comment "A valid SQL query."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:R2RMLView .

rr:parent a owl:DatatypeProperty ;
  rdfs:comment "Names a column in the parent table of a join."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:Join .

rr:tableName a owl:DatatypeProperty ;
  rdfs:comment "Schema-qualified name of a table or view."@en ;
  rdfs:range xsd:string ;
  rdfs:domain rr:BaseTableOrView .

rr:parentTriplesMap a owl:ObjectProperty ;
  rdfs:comment "Specifies the TriplesMap element corresponding to the parent logical table of the foreign key constraint."@en ;
  rdfs:range rr:TriplesMap ;
  rdfs:domain rr:RefObjectMap .

rr:sqlVersion a owl:ObjectProperty ;
  rdfs:comment "An identifier for a SQL version."@en ;
  rdfs:domain rr:R2RMLView .

rr:objectMap a owl:ObjectProperty ;
  rdfs:comment "An ObjectMap element to generate the object component of the (predicate, object) pair from a logical table row."@en ;
  rdfs:range [
    a owl:Class ;
    owl:unionOf ( rr:ObjectMap rr:RefObjectMap )
  ] ;
  rdfs:domain rr:PredicateObjectMap .

dcterms:contributor a owl:AnnotationProperty .

schema:inLanguage a owl:AnnotationProperty .

dcterms:license a owl:AnnotationProperty .

dc:issued a owl:AnnotationProperty .

dc:modified a owl:AnnotationProperty .

dc:publisher a owl:AnnotationProperty .

vann:preferredNamespacePrefix a owl:AnnotationProperty .

vann:preferredNamespaceUri a owl:AnnotationProperty .

skos:editorialNote a owl:AnnotationProperty .

sh:declare a owl:AnnotationProperty .

sh:prefix a owl:AnnotationProperty .

sh:namespace a owl:AnnotationProperty .
