@prefix cc:			<http://creativecommons.org/ns#> .
@prefix dcterms:		<http://purl.org/dc/terms/> .
@prefix xsd: 			<http://www.w3.org/2001/XMLSchema#> .
@prefix owl: 			<http://www.w3.org/2002/07/owl#> .
@prefix foaf: 			<http://xmlns.com/foaf/0.1/> .
@prefix ql: 			<http://semweb.mmlab.be/ns/ql#> .
@prefix rml: 			<http://semweb.mmlab.be/ns/rml#> .
@prefix rmlt: 			<http://semweb.mmlab.be/ns/rml-target#> .
@prefix rr: 			<http://www.w3.org/ns/r2rml#> .
@prefix rdf: 			<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: 			<http://www.w3.org/2000/01/rdf-schema#> .
@prefix vann: 			<http://purl.org/vocab/vann/> .
@prefix xml: 			<http://www.w3.org/XML/1998/namespace> .
@prefix : 	    		<http://semweb.mmlab.be/ns/rml#> .
@base 		    		<http://semweb.mmlab.be/ns/rml#> .

<>  rdf:type			owl:Ontology ;
    rdf:type 			<http://purl.org/vocommons/voaf#Vocabulary> ;
    dcterms:title 		"RML: Generic Mapping Language for RDF"@en ;
    rdf:type 			<http://purl.org/vocommons/voaf#Vocabulary> ;
    dcterms:issued 		"2013-07-01"^^<http://www.w3.org/2001/XMLSchema#date> ;
    dcterms:modified 		"2014-09-10"^^<http://www.w3.org/2001/XMLSchema#date> ;
    dcterms:description 	"Generic Mapping Language for RDF (RDB/CSV/TSV/XML/JSON/... to RDF) - Vocabulary description"@en ;
    dcterms:creator 		[ foaf:name "Anastasia Dimou" ], [ foaf:name "Miel Vander Sande"];
    cc:license 			<http://creativecommons.org/licenses/by/3.0/> ;
    vann:preferredNamespacePrefix "rml" ;
    vann:preferredNamespaceUri  "http://semweb.mmlab.be/ns/rml#";
    owl:imports 		<http://www.w3.org/ns/r2rml#>.
        


#################################################################
#
#    Object Properties
#
#################################################################


###  http://semweb.mmlab.be/ns/rml#logicalSource

rml:logicalSource rdf:type owl:ObjectProperty ;
    rdfs:label    "logical source" ;
    rdfs:comment  "Represents the logical source to be mapped. This can be a pointer to any dataset."@en ;
    rdfs:range    rml:LogicalSource;
    rdfs:domain   rr:TriplesMap .
               
###  http://semweb.mmlab.be/ns/rml#logicalTarget

rml:logicalTarget rdf:type owl:ObjectProperty ;
    rdfs:label    "logical target" ;
    rdfs:comment  "Represents the logical target to where triples are exported to. This can be a pointer to any dataset."@en ;
    rdfs:range    rmlt:LogicalTarget;
    rdfs:domain   rr:TriplesMap .

###  http://semweb.mmlab.be/ns/rml#referenceFormulation

rml:referenceFormulation rdf:type owl:ObjectProperty ;
    rdfs:comment "The reference formulation used to refer to extracts of the source data. "@en ;
    rdfs:label   "reference formulation" ;
    rdfs:domain  rml:LogicalSource;
    rdfs:range   rml:ReferenceFormulation .



#################################################################
#
#    Data properties
#
#################################################################


###  http://semweb.mmlab.be/ns/rml#iterator

rml:iterator rdf:type owl:DatatypeProperty ;
    rdfs:label   "iterator" ;
    rdfs:comment "an expression qualified according to the reference formulation specified for pointing to an extract of the source data. "@en ;
    rdfs:domain  rml:LogicalSource;
    rdfs:range   xsd:string .


###  http://www.w3.org/ns/r2rml#column - extended in RML

rr:column rdfs:subPropertyOf rml:reference .


###  http://semweb.mmlab.be/ns/rml#reference

rml:reference rdf:type owl:DatatypeProperty ;
    rdfs:label   "reference" ;
    rdfs:comment "A valid expression that selects values from the source data. The reference should confront to the syntax rules/grammar of the specified Reference Formulation. "@en ;
    rdfs:domain  rr:TermMap;
    rdfs:range   xsd:string .


###  http://semweb.mmlab.be/ns/rml#version

rml:version rdf:type owl:DatatypeProperty ;
    rdfs:label   "version" ;
    rdfs:comment "It defines the version of the reference Formulation used. "@en ;
    rdfs:domain  rml:LogicalSource;
    rdfs:range   xsd:string .


###  http://semweb.mmlab.be/ns/rml#sqlVersion - extended in RML

rr:sqlVersion rdfs:subPropertyOf rml:version .


###  http://semweb.mmlab.be/ns/rml#source

rml:source rdf:type rdf:Property ;
    rdfs:label   "source" ;
    rdfs:comment "qualified name of the source data."@en ;
    rdfs:domain  rml:LogicalSource .


###  http://www.w3.org/ns/r2rml#tableName - extended in RML

rr:tableName rdfs:subPropertyOf rml:source .


###  http://mmlab.be/rml#query

rml:query rdf:type owl:DatatypeProperty ;
    rdfs:comment "A valid query."@en ;
    rdfs:domain  rml:LogicalSource .


###  http://www.w3.org/ns/r2rml#sqlQuery - extended in RML

rr:sqlQuery rdfs:subPropertyOf rml:query .


###  http://www.w3.org/ns/r2rml#object

rr:object rdfs:domain [ 
    rdf:type owl:Class ;
    owl:intersectionOf ( rr:ObjectMap
    [ rdf:type owl:Restriction ;
      #extended in RML
      owl:onProperty rml:reference ;
      owl:maxQualifiedCardinality "0"^^xsd:nonNegativeInteger ;
      owl:onDataRange xsd:string ] )
    ] .


###  http://www.w3.org/ns/r2rml#predicate

rr:predicate rdfs:domain [ 
    rdf:type owl:Class ;
    owl:intersectionOf ( rr:PredicateMap
        [ rdf:type owl:Restriction ;
          #extended in RML
          owl:onProperty rml:reference ;
          owl:maxQualifiedCardinality "0"^^xsd:nonNegativeInteger ;
          owl:onDataRange xsd:string
        ] )
    ] .

###  http://www.w3.org/ns/r2rml#subject

rr:subject rdfs:domain [ 
    rdf:type owl:Class ;
    owl:intersectionOf ( rr:SubjectMap
        [ rdf:type owl:Restriction ;
          #extended in RML
          owl:onProperty rml:reference ;
          owl:maxQualifiedCardinality "0"^^xsd:nonNegativeInteger ;
          owl:onDataRange xsd:string
        ] )
    ] .



#################################################################
#
#    Classes
#
#################################################################

###  http://semweb.mmlab.be/ns/rml#TriplesMap

rml:TriplesMap rdfs:subClassOf owl:Thing,
  [
    rdf:type     owl:Restriction ;
    owl:onProperty rml:logicalSource ;
    owl:onClass  rml:LogicalSource ;
    owl:minQualifiedCardinality "1"^^xsd:nonNegativeInteger
  ],
  [ rdf:type owl:Restriction ;
      owl:onProperty rr:subjectMap ;
      owl:onClass rr:SubjectMap ;
      owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
  ] ; 
  rdfs:comment "Represents a triples map."@en .


###  http://www.w3.org/ns/r2rml#TriplesMap - extended in RML

rr:TriplesMap rdfs:subClassOf rml:TriplesMap .
   

###  http://semweb.mmlab.be/ns/rml#BaseSource

rml:BaseSource rdf:type owl:Class ;
    rdfs:label   "Base Source" ;
    rdfs:comment "Base Source" ;
    rdfs:subClassOf rml:LogicalSource ;
    rdfs:comment "Represents a base source."@en  .


###  http://semweb.mmlab.be/ns/rml#LogicalSource

rml:LogicalSource rdf:type owl:Class ;
    rdfs:subClassOf owl:Thing,
      [
        rdf:type     owl:Restriction ;
        owl:onProperty rml:referenceFormulation ;
        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
      ],
      [
        rdf:type     owl:Restriction ;
        owl:onProperty rml:iterator ;
        owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger
      ],
      [
        rdf:type     owl:Restriction ;
        owl:onProperty rml:source ;
        owl:minQualifiedCardinality "1"^^xsd:nonNegativeInteger
      ];
    rdfs:label   "Logical Source" ;
    rdfs:subClassOf owl:Thing ;
    rdfs:comment "Represents a logical source."@en .


###  http://www.w3.org/ns/r2rml#LogicalTable - extended in RML

rr:LogicalTable rdfs:subClassOf rml:LogicalSource .


###  http://semweb.mmlab.be/ns/rml#ReferenceFormulation

rml:ReferenceFormulation rdf:type owl:Class ;
    rdfs:label   "Reference Formulation" ;
    rdfs:comment "Represents a Reference Formulation."@en .



#################################################################
#
#    Individuals
#
#################################################################


###  http://semweb.mmlab.be/ns/ql/CSV

ql:CSV rdf:type owl:NamedIndividual, rml:ReferenceFormulation ;
    rdfs:label   "CSV" ; 
    rdfs:comment "Denotes that the CSV file's column names are used for referring to extracts of CSV resources."@en ;
    ql:specification <http://tools.ietf.org/html/rfc4180>.


###  http://semweb.mmlab.be/ns/ql/XPath

ql:XPath rdf:type owl:NamedIndividual, rml:ReferenceFormulation  ;
    rdfs:label   "XPath" ; 
    rdfs:comment "Denotes the XPath reference formulation, used for referring to extracts of XML sources."@en ;
    ql:specification <http://www.w3.org/TR/xpath20/> ;
    rml:version "2.0".


###  http://semweb.mmlab.be/ns/ql/JSONPath

ql:JSONPath rdf:type owl:NamedIndividual, rml:ReferenceFormulation  ; 
    rdfs:label   "JSONPath" ;
    rdfs:comment "Denotes the JSONPath reference formulation, used for referring to extracts of JSON sources."@en .

ql:CSS3 rdf:type owl:NamedIndividual, rml:ReferenceFormulation  ;
    rdfs:label   "Selectors Level 3" ;
    rdfs:comment "Denotes the selectors, namely the patterns that match against elements in a tree and are used in CSS and other thechnolgies to select elements in HTML or XML documents." ;
    ql:specification <http://www.w3.org/TR/css3-selectors/> .

