@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix csvw: <http://www.w3.org/ns/csvw#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcam: <http://purl.org/dc/dcam/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix prof: <http://www.w3.org/ns/dx/prof/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rml: <http://w3id.org/rml/> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix wgs: <https://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://w3id.org/rml/shapes/RMLChildMapShape> a sh:NodeShape ;
    rdfs:label "ChildMap" ;
    rdfs:comment """
    Represents a Child Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLExpressionMapShape> [ ] ) ;
    sh:message """
    rml:ChildMap must specify a literal referencing data in the child data
    source.
    """ ;
    sh:targetClass <http://www.w3.org/ns/r2rml#ChildMap> ;
    sh:targetObjectsOf <http://www.w3.org/ns/r2rml#childMap> .

<http://w3id.org/rml/shapes/RMLDatatypeMapShape> a sh:NodeShape ;
    rdfs:label "DatatypeMap" ;
    rdfs:comment """
    Represents a Datatype Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLExpressionMapShape> [ ] ) ;
    sh:message """
    rml:DatatypeMap must specify an rml:template, rml:reference, or rml:constant
    with the IRI of the datatype.
    """ ;
    sh:targetClass rml:DatatypeMap ;
    sh:targetObjectsOf rml:datatypeMap .

<http://w3id.org/rml/shapes/RMLGraphMapShape> a sh:NodeShape ;
    rdfs:label "GraphMap" ;
    rdfs:comment """
    Represents a Graph Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLTermMapShape> <http://w3id.org/rml/shapes/RMLLogicalTargetPropertiesShape> [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode ) ;
                sh:message """
            rml:termType must be an rml:IRI, rml:UnsafeIRI, rml:URI,
            rml:UnsafeURI, or rml:BlankNode for a Graph Map.
            """ ;
                sh:path rml:termType ] ) ;
    sh:message """
    rml:GraphMap must specify an rml:template, rml:reference or rml:constant 
    with the IRI of the Named Graph.
    """ ;
    sh:targetClass rml:GraphMap ;
    sh:targetObjectsOf rml:graphMap .

<http://w3id.org/rml/shapes/RMLJoinShape> a sh:NodeShape ;
    rdfs:label "Join" ;
    rdfs:comment """
    Represents a Join.
    """ ;
    sh:message """
    rml:Join must specify exactly one rml:parent/rml:parentMap 
    and rml:child/rml:childMap.
    """ ;
    sh:property [ rdfs:label "parentMap/parent" ;
            rdfs:comment """
        rml:parent/rml:parentMap may only be provided once and 
        not at the same time.
        """ ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:path [ sh:alternativePath ( rml:parentMap rml:parent ) ] ],
        [ rdfs:label "childMap" ;
            rdfs:comment """
        Specifies the child of the object component for joining.
        """ ;
            sh:message """
        rml:childMap must point to a rml:ChildMap specifying the
        child of the Literal.
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:childMap ;
            sh:targetSubjectsOf rml:childMap ],
        [ rdfs:label "child" ;
            rdfs:comment """
        Specifies the child of the object component for joining.
        """ ;
            sh:nodeKind sh:Literal ;
            sh:path rml:child ;
            sh:targetSubjectsOf rml:child ],
        [ rdfs:label "parentMap" ;
            rdfs:comment """
        Specifies the parent of the object component for joining.
        """ ;
            sh:message """
        rml:parentMap must point to a rml:ParentMap specifying the 
        parent tag of the string Literal.
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:parentMap ;
            sh:targetSubjectsOf rml:parentMap ],
        [ rdfs:label "parent" ;
            rdfs:comment """
        Specifies the parent of the object component for joining.
        """ ;
            sh:nodeKind sh:Literal ;
            sh:path rml:parent ;
            sh:targetSubjectsOf rml:parent ],
        [ rdfs:label "childMap/child" ;
            rdfs:comment """
        rml:child/rml:childMap may only be provided once and 
        not at the same time.
        """ ;
            sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:path [ sh:alternativePath ( rml:childMap rml:child ) ] ] ;
    sh:targetClass rml:Join ;
    sh:targetObjectsOf rml:joinCondition .

<http://w3id.org/rml/shapes/RMLLanguageMapShape> a sh:NodeShape ;
    rdfs:label "LanguageMap" ;
    rdfs:comment """
    Represents a Language Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLExpressionMapShape> [ sh:path rml:constant ;
                sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ] ) ;
    sh:message """
    rml:LanguageMap must specify an rml:template, rml:reference, or rml:constant
    with the BCP47 name of the language as string.
    """ ;
    sh:targetClass rml:LanguageMap ;
    sh:targetObjectsOf rml:languageMap .

<http://w3id.org/rml/shapes/RMLParentMapShape> a sh:NodeShape ;
    rdfs:label "ParentMap" ;
    rdfs:comment """
    Represents a Parent Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLExpressionMapShape> [ ] ) ;
    sh:message """
    rml:ParentMap must specify a literal referencing data in the parent data
    source.
    """ ;
    sh:targetClass rml:ParentMap ;
    sh:targetObjectsOf rml:parentMap .

<http://w3id.org/rml/shapes/RMLPredicateMapShape> a sh:NodeShape ;
    rdfs:label "PredicateMap" ;
    rdfs:comment """
    Represents a Predicate Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLTermMapShape> <http://w3id.org/rml/shapes/RMLLogicalTargetPropertiesShape> [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI ) ;
                sh:message """
            rml:termType for Predicate Map can only be a rml:IRI, rml:UnsafeIRI,
            rml:URI, or rml:UnsafeURI;
            """ ;
                sh:path rml:termType ] ) ;
    sh:message """
    Predicate Object Map must generate an IRI representing the predicate of an 
    RDF triple.
    """ ;
    sh:targetClass rml:PredicateMap ;
    sh:targetObjectsOf rml:predicateMap .

<http://w3id.org/rml/shapes/RMLPredicateObjectMapShape> a sh:NodeShape ;
    rdfs:label "PredicateObjectMap" ;
    rdfs:comment """
    Represents a Predicate Object Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLGraphMapPropertiesShape> <http://w3id.org/rml/shapes/RMLLogicalTargetPropertiesShape> [ rdfs:label "predicate/predicateMap" ;
                rdfs:comment """
            At least one rml:predicate or rml:predicateMap must be provided.
            """ ;
                sh:message """
            At least one rml:predicate or rml:predicateMap must be provided.
            """ ;
                sh:minCount 1 ;
                sh:path [ sh:alternativePath ( rml:predicate rml:predicateMap ) ] ;
                sh:targetSubjectsOf rml:predicate,
                    rml:predicateMap ] [ rdfs:label "predicateMap" ;
                rdfs:comment """
            A PredicateMap element to generate the predicate component of the 
            (predicate, object) pair from a logical table row or iterator.
            """ ;
                sh:message """
            rml:predicateMap must be an IRI or blank node and be provided once.
            """ ;
                sh:nodeKind sh:BlankNodeOrIRI ;
                sh:path rml:predicateMap ;
                sh:targetSubjectsOf rml:predicateMap ] [ rdfs:label "predicate" ;
                rdfs:comment """
            Specifies the predicate for the generated triple from the logical table 
            row or iterator.
            """ ;
                sh:message """
            rml:predicate must be an IRI and be provided once.
            """ ;
                sh:nodeKind sh:IRI ;
                sh:path rml:predicate ;
                sh:targetSubjectsOf rml:predicate ] [ rdfs:label "object/objectMap/quotedTriplesMap" ;
                rdfs:comment """
            Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple.
            """ ;
                sh:message """
            Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple
            """ ;
                sh:minCount 1 ;
                sh:path [ sh:alternativePath ( rml:object rml:objectMap rml:quotedTriplesMap ) ] ;
                sh:targetSubjectsOf rml:object,
                    rml:objectMap,
                    rml:quotedTriplesMap ] [ rdfs:label "objectMap" ;
                rdfs:comment """
            An ObjectMap element to generate the object component of the 
            (predicate, object) pair from a logical table row or iterator.
            """ ;
                sh:message """
            rml:objectMap must be an IRI or blank node and be provided once.
            """ ;
                sh:nodeKind sh:BlankNodeOrIRI ;
                sh:or ( [ sh:node <http://w3id.org/rml/shapes/RMLObjectMapShape> ] [ sh:node <http://w3id.org/rml/shapes/RMLRefObjectMapShape> ] [ sh:node <http://w3id.org/rml/shapes/RMLStarMapShape> ] ) ;
                sh:path rml:objectMap ;
                sh:targetSubjectsOf rml:objectMap ] [ rdfs:label "object" ;
                rdfs:comment """
            Specifies the object for the generated RDF triples.
            """ ;
                sh:message """
            rml:object must be an IRI and be provided once.
            """ ;
                sh:path rml:object ;
                sh:targetSubjectsOf rml:object ] ) ;
    sh:targetClass rml:PredicateObjectMap ;
    sh:targetObjectsOf rml:predicateObjectMap .

<http://w3id.org/rml/shapes/RMLStrategyAppendShape> a sh:NodeShape ;
    rdfs:label "Strategy" ;
    rdfs:comment """
    Strategy to follow when generating RDF triples.
    """ ;
    sh:in ( rml:append rml:cartesianProduct ) ;
    sh:message """
    Strategy must be either rml:append or rml:cartesianProduct.
    """ ;
    sh:targetObjectsOf rml:strategy .

<http://w3id.org/rml/shapes/RMLTriplesMapShape> a sh:NodeShape ;
    rdfs:label "TriplesMap" ;
    rdfs:comment """
    Represents a Triples Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLTriplesMapPropertiesShape> [ ] ) ;
    sh:message """
    Triples Map requires exactly one rml:subject or one rml:subjectMap and zero
    or more rml:predicateObjectMaps.
    """ ;
    sh:targetClass rml:TriplesMap ;
    sh:targetObjectsOf rml:parentTriplesMap .

<http://w3id.org/rml/shapes/RMLchildShape> a sh:NodeShape ;
    rdfs:label "child" ;
    rdfs:comment """
    A Literal reference to use as reference to the child data source.
    """ ;
    sh:datatype xsd:string ;
    sh:message """
    rml:child shortcut for rml:ChildMap must be a Literal.
    """ ;
    sh:nodeKind sh:Literal ;
    sh:targetObjectsOf <http://www.w3.org/ns/r2rml#child> .

<http://w3id.org/rml/shapes/RMLdatatypeShape> a sh:NodeShape ;
    rdfs:label "datatype" ;
    rdfs:comment """
    An IRI reference for use as the graph name of all triples generated with 
    the datatype.
    """ ;
    sh:message """
    rml:datatype must be an IRI.
    """ ;
    sh:nodeKind sh:IRI ;
    sh:targetObjectsOf rml:datatype .

<http://w3id.org/rml/shapes/RMLgraphShape> a sh:NodeShape ;
    rdfs:label "graph" ;
    rdfs:comment """
    An IRI reference for use as the graph name of all triples generated with 
    the Graph Map. 
    """ ;
    sh:message """
    rml:graph must be an IRI or blank node.
    """ ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:targetObjectsOf rml:graph .

<http://w3id.org/rml/shapes/RMLlanguageShape> a sh:NodeShape ;
    rdfs:label "language" ;
    rdfs:comment """
    Specified the language for the generated Literal.
    """ ;
    sh:message """
    rml:language must be a valid language tag according to BCP47 and may
    only be provided once as string.
    """ ;
    sh:nodeKind sh:Literal ;
    sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ;
    sh:targetObjectsOf rml:language .

<http://w3id.org/rml/shapes/RMLobjectShape> a sh:NodeShape ;
    rdfs:label "object" ;
    rdfs:comment """
    An IRI, Blank Node, or Literal to use as object for all the RDF triples.
    """ ;
    sh:message """
    rml:object shortcut for rml:objectMap must be an IRI, Blank Node, 
    or Literal.
    """ ;
    sh:targetObjectsOf rml:object .

<http://w3id.org/rml/shapes/RMLparentShape> a sh:NodeShape ;
    rdfs:label "parent" ;
    rdfs:comment """
    A Literal reference to use as reference to the parent data source.
    """ ;
    sh:datatype xsd:string ;
    sh:message """
    rml:parent shortcut for rml:ParentMap must be a Literal.
    """ ;
    sh:nodeKind sh:Literal ;
    sh:targetObjectsOf rml:parent .

<http://w3id.org/rml/shapes/RMLpredicateShape> a sh:NodeShape ;
    rdfs:label "predicate" ;
    rdfs:comment """
    Specifies the predicate for the generated triple.
    """ ;
    sh:message """
    rml:predicate must be an IRI.
    """ ;
    sh:nodeKind sh:IRI ;
    sh:targetObjectsOf rml:predicate .

<http://w3id.org/rml/shapes/RMLsubjectShape> a sh:NodeShape ;
    rdfs:label "subject" ;
    rdfs:comment """
    An IRI reference to use as subject for all the RDF triples.
    """ ;
    sh:message """
    rml:subject shortcut for rml:SubjectMap must be a IRI or BlankNode.
    """ ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:targetObjectsOf rml:subject .

<http://w3id.org/rml/shapes/RMLAbstractLogicalSourceShape> a sh:NodeShape ;
    rdfs:label "Abstract Logical Source" ;
    rdfs:comment """
    A sub-class of iterable that can be associated with a triples map such that a data source can be mapped to RDF triples.
    """ ;
    sh:message """
    rml:AbstractLogicalSource must specify how to generate logical iterations on a data source for a triples map.
    """ ;
    sh:node <http://w3id.org/rml/shapes/RMLIterableShape> ;
    sh:targetClass rml:AbstractLogicalSource ;
    sh:targetObjectsOf rml:logicalSource .

<http://w3id.org/rml/shapes/RMLIterableShape> a sh:NodeShape ;
    rdfs:label "Iterable" ;
    rdfs:comment """
    An abstract construct to describe data access and iteration for a data source.
    """ ;
    sh:message """
    Iterable must specify how to generate logical iterations on a data source.
    """ ;
    sh:property [ rdfs:label "rml:referenceFormulation" ;
            rdfs:comment """
        The reference formulation (rml:referenceFormulation) defines how to 
        reference to elements of the data of the input source.
        """ ;
            sh:maxCount 1 ;
            sh:message """
        rml:referenceFormulation must be a blank node or IRI specifying the 
        reference formulation on how to reference elements of a data source,
        and may be provided at most once.
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:referenceFormulation ],
        [ rdfs:label "rml:iterator" ;
            rdfs:comment """
        The logical iterator (rml:iterator) defines the iteration loop used to 
        map the data of the input source. Depends on the reference formulation
        if an iterator is necessary.  
        """ ;
            sh:maxCount 1 ;
            sh:message """
        rml:iterator specifies the iterator to iterate over
        the data source, and may be provided at most once.
        """ ;
            sh:path rml:iterator ] ;
    sh:targetClass rml:Iterable .

<http://w3id.org/rml/shapes/RMLJoinConditionPropertiesShape> a sh:PropertyShape ;
    rdfs:label "joinCondition" ;
    rdfs:comment """
    Specifies the join condition for joining a child data source with 
    a parent data source of the foreign key constraint.
    """ ;
    sh:message """
    rml:joinCondition must specify an rml:parent and rml:child.
    """ ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:path rml:joinCondition ;
    sh:targetSubjectsOf rml:joinCondition .

<http://w3id.org/rml/shapes/RMLObjectMapShape> a sh:NodeShape ;
    rdfs:label "ObjectMap" ;
    rdfs:comment """
    Represents an Object Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLTermMapShape> <http://w3id.org/rml/shapes/RMLLogicalTargetPropertiesShape> [ rdfs:label "languageMap/datatypeMap/language/datatype" ;
                rdfs:comment """
            rml:language/rml:languageMap and rml:datatype/rml:datatypeMap
            may only be provided once and not at the same time.
            """ ;
                sh:maxCount 1 ;
                sh:minCount 0 ;
                sh:path [ sh:alternativePath ( rml:languageMap rml:datatypeMap rml:language rml:datatype ) ] ] [ rdfs:label "languageMap" ;
                rdfs:comment """
            Specified the language map for the object component for the 
            generated RDF triples.
            """ ;
                sh:message """
            rml:languageMap must point to a rml:LanguageMap specifying the 
            language tag of the string Literal.
            """ ;
                sh:nodeKind sh:BlankNodeOrIRI ;
                sh:path rml:languageMap ;
                sh:targetSubjectsOf rml:languageMap ] [ rdfs:label "datatypeMap" ;
                rdfs:comment """
            Specifies the datatype of the object component for the generated 
            RDF triples.
            """ ;
                sh:message """
            rml:datatypeMap must point to a rml:DatatypeMap specifying the
            datatype of the Literal.
            """ ;
                sh:nodeKind sh:BlankNodeOrIRI ;
                sh:path rml:datatypeMap ;
                sh:targetSubjectsOf rml:datatypeMap ] [ rdfs:label "language" ;
                rdfs:comment """
            Language tag for the object.
            """ ;
                sh:nodeKind sh:Literal ;
                sh:path rml:language ] [ rdfs:label "datatype" ;
                rdfs:comment """
            Datatype for the object.
            """ ;
                sh:nodeKind sh:IRI ;
                sh:path rml:datatype ;
                sh:targetSubjectsOf rml:datatype ] ) ;
    sh:message """
    Object Map must generate a IRI, Blank Node, or Literal which has optionally
    a language tag or datatype.
    """ ;
    sh:targetClass rml:ObjectMap .

<http://w3id.org/rml/shapes/RMLRefObjectMapShape> a sh:NodeShape ;
    rdfs:label "RefObjectMap" ;
    rdfs:comment """
    Represents a Reference Object Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLJoinConditionPropertiesShape> [ rdfs:label "parentTriplesMap" ;
                rdfs:comment """
            Specifies the Triples Map element corresponding to the parent data
            source of the foreign key constraint.
            """ ;
                sh:class rml:TriplesMap ;
                sh:maxCount 1 ;
                sh:message """
            rml:parentTriplesMap may only be provided once and must be an IRI
            or Blank Node referring to a Triples Map.
            """ ;
                sh:minCount 1 ;
                sh:nodeKind sh:BlankNodeOrIRI ;
                sh:path rml:parentTriplesMap ;
                sh:targetSubjectsOf rml:parentTriplesMap ] ) ;
    sh:message """
    rml:RefObjectMap must specify a rml:parentTriplesMap and zero or more 
    rml:joinConditions.
    """ ;
    sh:targetClass rml:RefObjectMap .

<http://w3id.org/rml/shapes/RMLSubjectMapShape> a sh:NodeShape ;
    rdfs:label "SubjectMap" ;
    rdfs:comment """
    Represents a Subject Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLTermMapShape> <http://w3id.org/rml/shapes/RMLGraphMapPropertiesShape> <http://w3id.org/rml/shapes/RMLLogicalTargetPropertiesShape> [ rdfs:label "class" ;
                rdfs:comment """
            The subject value generated will be asserted as an instance of this
            RDFS class.
            """ ;
                sh:message """
            rml:class must be an IRI and may be specified multiple times.
            """ ;
                sh:nodeKind sh:IRI ;
                sh:path rml:class ;
                sh:targetSubjectsOf rml:class ] [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode ) ;
                sh:message """
            rml:termType must be a rml:IRI, rml:UnsafeIRI, rml:URI,
            rml:UnsafeURI, or rml:BlankNode for a Subject Map.
            """ ;
                sh:path rml:termType ] ) ;
    sh:message """
    Subject Map must generate a resource representing the subject of
    an RDF triple.
    """ ;
    sh:targetClass rml:SubjectMap ;
    sh:targetObjectsOf rml:subjectMap .

<http://w3id.org/rml/shapes/RMLTriplesMapPropertiesShape> a sh:NodeShape ;
    sh:property [ rdfs:label "logicalSource" ;
            rdfs:comment """
        A logical source is any source that is mapped to RDF triples.
        """ ;
            sh:maxCount 1 ;
            sh:message """
        Exactly one rml:logicalSource is required to access the data source.
        """ ;
            sh:minCount 1 ;
            sh:node <http://w3id.org/rml/shapes/RMLAbstractLogicalSourceShape> ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:logicalSource ;
            sh:targetSubjectsOf rml:logicalSource ],
        [ rdfs:label "subject" ;
            rdfs:comment """
        An IRI reference for use as subject for all generated RDF triples.
        """ ;
            sh:message """
        rml:subject must be an IRI or blank node.
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:subject ;
            sh:targetSubjectsOf rml:subject ],
        [ rdfs:label "predicateObjectMap" ;
            rdfs:comment """
        A Predicate Object Map element to generate a (predicate, object) pair.
        """ ;
            sh:message """
        rml:PredicateObjectMap must be an IRI or blank node.
        """ ;
            sh:minCount 0 ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:predicateObjectMap ;
            sh:targetSubjectsOf rml:predicateObjectMap ],
        [ sh:description """
        Base IRI to use for generating RDF triples or quads.
        """ ;
            sh:maxCount 1 ;
            sh:message """
        rml:baseIRI must be an IRI.
        """ ;
            sh:minCount 0 ;
            sh:nodeKind sh:IRI ;
            sh:path rml:baseIRI ],
        [ rdfs:label "subjectMap/subject/quotedTriplesMap" ;
            rdfs:comment """
        Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple.
        """ ;
            sh:maxCount 1 ;
            sh:message """
        Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple.
        """ ;
            sh:minCount 1 ;
            sh:path [ sh:alternativePath ( rml:subjectMap rml:subject rml:quotedTriplesMap ) ] ;
            sh:targetSubjectsOf rml:quotedTriplesMap,
                rml:subject,
                rml:subjectMap ],
        [ rdfs:label "subjectMap" ;
            rdfs:comment """
        A Subject Map element to generate a subject for generated RDF triples.
        """ ;
            sh:message """
        rml:SubjectMap must be an IRI or blank node.
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:or ( [ sh:node <http://w3id.org/rml/shapes/RMLSubjectMapShape> ] [ sh:node <http://w3id.org/rml/shapes/RMLStarMapShape> ] ) ;
            sh:path rml:subjectMap ;
            sh:targetSubjectsOf rml:subjectMap ] ;
    sh:targetClass rml:NonAssertedTriplesMap,
        rml:TriplesMap .

<http://w3id.org/rml/shapes/RMLGraphMapPropertiesShape> a sh:NodeShape ;
    sh:property [ rdfs:label "graph/graphMap" ;
            rdfs:comment """
        Either an rml:graph or rml:graphMap may be optionally be provided,
        but not both.
        """ ;
            sh:maxCount 1 ;
            sh:message """
        Either an rml:graph or rml:graphMap may be optionally be provided,
        but not both.
        """ ;
            sh:minCount 0 ;
            sh:path [ sh:alternativePath ( rml:graph rml:graphMap ) ] ],
        [ rdfs:label "graphMap" ;
            rdfs:comment """
        Specifies a Graph Map. When used with a Subject Map element, all the
        RDF triples generated 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.
        """ ;
            sh:message """
        rml:graphMap must be either an IRI or blank node. 
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:graphMap ],
        [ rdfs:label "graph" ;
            rdfs:comment """
        An IRI reference to use as the named graph of all generated triples.
        """ ;
            sh:message """
        rml:graphMap must be an IRI. 
        """ ;
            sh:nodeKind sh:IRI ;
            sh:path rml:graph ] ;
    sh:targetSubjectsOf rml:graph,
        rml:graphMap .

<http://w3id.org/rml/shapes/RMLStarMapShape> a sh:NodeShape .

<http://w3id.org/rml/shapes/RMLTermMapShape> a sh:NodeShape ;
    rdfs:label "TermMap" ;
    rdfs:comment """
    Represents a Term Map.
    """ ;
    sh:and ( <http://w3id.org/rml/shapes/RMLExpressionMapShape> [ rdfs:label "termType" ;
                rdfs:comment """
            An IRI indicating whether a generated term should be an IRI, 
            Blank Node, or a Literal.
            """ ;
                sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:Literal rml:BlankNode ) ;
                sh:maxCount 1 ;
                sh:message """
            rml:termType must be either rml:IRI, rml:UnsafeIRI,
            rml:URI, rml:UnsafeURI, rml:Literal, or rml:BlankNode for a Term Map.
            May only be provided once.
            """ ;
                sh:nodeKind sh:IRI ;
                sh:path rml:termType ;
                sh:targetSubjectsOf rml:termType ] ) ;
    sh:message """
    Term Map is an Expression Map with optionally a term type specified.
    """ .

<http://w3id.org/rml/shapes/RMLExpressionMapShape> a sh:NodeShape ;
    rdfs:label "ExpressionMap" ;
    rdfs:comment """
    Represents a Expression Map.
    """ ;
    sh:message """
    Expression Map may require one rml:template or one rml:constant or one
    rml:reference.
    """ ;
    sh:or ( [ sh:not [ sh:property [ sh:minCount 1 ;
                                sh:path rml:returnMap ] ] ] [ sh:property [ sh:maxCount 1 ;
                        sh:minCount 1 ;
                        sh:path rml:returnMap ],
                    [ sh:maxCount 1 ;
                        sh:minCount 1 ;
                        sh:path rml:functionExecution ] ] ) ;
    sh:property [ rdfs:label "template/constant/reference/functionExecution" ;
            rdfs:comment """
            Only one rml:template, one rml:constant, one rml:reference,
            or one rml:functionExecution is allowed. rml:returnMap is only allowed if rml:functionExecution is present.
        """ ;
            sh:maxCount 1 ;
            sh:message """
        Exactly one rml:template, one rml:constant, one rml:reference,
        one rml:returnMap, or one rml:functionExecution is required.
        """ ;
            sh:path [ sh:alternativePath ( rml:template rml:constant rml:reference rml:functionExecution ) ] ;
            sh:targetSubjectsOf rml:constant,
                rml:functionExecution,
                rml:reference,
                rml:template ],
        [ rdfs:label "returnMap" ;
            rdfs:comment """
        A Return Map rml:returnMap is used to define the return values of a FnO
        function from the RML-FNML specification. RML Core only validates if the
        property is present and has the right node kind. The actual validation
        happens with RML-FNML SHACL shapes.
        """ ;
            sh:message """
        rml:returnMap must be an IRI;
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:returnMap ;
            sh:targetSubjectsOf rml:returnMap ],
        [ rdfs:label "functionExecution" ;
            rdfs:comment """
        A Function Execution rml:functionExecution is used to define the FnO 
        function to execute from the RML-FNML specification. RML Core only 
        validates if the property is present and has the right node kind.
        The actual validation happens with RML-FNML SHACL shapes.
        """ ;
            sh:message """
        rml:functionExecution must be an IRI;
        """ ;
            sh:nodeKind sh:BlankNodeOrIRI ;
            sh:path rml:functionExecution ;
            sh:targetSubjectsOf rml:functionExecution ],
        [ rdfs:label "template" ;
            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 or iterator.
        """ ;
            sh:datatype xsd:string ;
            sh:message """
        rml:template must be a string.
        """ ;
            sh:nodeKind sh:Literal ;
            sh:path rml:template ],
        [ rdfs:label "constant" ;
            rdfs:comment """
        A property for indicating whether a term map is a constant-valued term 
        map.
        """ ;
            sh:message """
        rml:constant must be an IRI or Literal.
        """ ;
            sh:path rml:constant ;
            sh:targetSubjectsOf rml:constant ],
        [ rdfs:label "reference" ;
            rdfs:comment """
        A reference rml:reference is used to refer to a column in case of 
        databases, a record in case of CSV or TSV data source, an element in 
        case of XML data source, an object in case of a JSON data source, etc.

        A reference must be a valid identifier, considering the reference 
        formulation (rml:referenceFormulation) specified. The reference can be
        an absolute path, or a path relative to the iterator specified at the 
        logical source. 
        """ ;
            sh:datatype xsd:string ;
            sh:message """
        rml:reference must be a string.
        """ ;
            sh:nodeKind sh:Literal ;
            sh:path rml:reference ;
            sh:targetSubjectsOf rml:reference ] .

<http://w3id.org/rml/shapes/RMLLogicalTargetPropertiesShape> a sh:PropertyShape ;
    rdfs:label "logicalTarget" ;
    rdfs:comment """
    A logical target is any target to where generated RDF triples are
    exported to.
    """ ;
    sh:message """
    Zero or more rml:logicalTarget is required to export RDF triples.
    """ ;
    sh:minCount 0 ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:path rml:logicalTarget ;
    sh:targetSubjectsOf rml:logicalTarget .

