1 @base <http://n2t.net/ark:/99152/> .
    2 @prefix bibo: <http://purl.org/ontology/bibo/> .
    3 @prefix dce: <http://purl.org/dc/elements/1.1/> .
    4 @prefix dcterms: <http://purl.org/dc/terms/> .
    5 @prefix foaf: <http://xmlns.com/foaf/0.1/> .
    6 @prefix lvont: <http://lexvo.org/ontology#> .
    7 @prefix owl: <http://www.w3.org/2002/07/owl#> .
    8 @prefix periodo: <p0v#> .
    9 @prefix prov: <http://www.w3.org/ns/prov#> .
   10 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
   11 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
   12 @prefix sh: <http://www.w3.org/ns/shacl#> .
   13 @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
   14 @prefix time: <http://www.w3.org/2006/time#> .
   15 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
   16 
   17 periodo:submitted a prov:Role ;
   18     rdfs:comment "The role played by the agent responsible for submitting a patch."@en ;
   19     rdfs:isDefinedBy <http://n2t.net/ark:/99152/p0v> ;
   20     rdfs:label "submitted"@en .
   21 
   22 periodo:updated a prov:Role ;
   23     rdfs:comment "The role played by the agent responsible for updating a patch."@en ;
   24     rdfs:isDefinedBy <http://n2t.net/ark:/99152/p0v> ;
   25     rdfs:label "updated"@en .
   26 
   27 periodo:merged a prov:Role ;
   28     rdfs:comment "The role played by the agent responsible for merging a patch."@en ;
   29     rdfs:isDefinedBy <http://n2t.net/ark:/99152/p0v> ;
   30     rdfs:label "merged"@en .
   31 
   32 periodo:spatialCoverageDescription a owl:DatatypeProperty ;
   33     rdfs:comment "Free-text description of the spatial coverage of a resource."@en ;
   34     rdfs:isDefinedBy <http://n2t.net/ark:/99152/p0v> ;
   35     rdfs:label "spatial coverage description"@en ;
   36     rdfs:range xsd:string .
   37 
   38 periodo:earliestYear a owl:DatatypeProperty ;
   39     rdfs:comment "The earliest Gregorian year referred to in the description of a temporal interval."@en ;
   40     rdfs:isDefinedBy <http://n2t.net/ark:/99152/p0v> ;
   41     rdfs:label "earliest year"@en ;
   42     rdfs:domain time:DateTimeDescription ;
   43     rdfs:range xsd:gYear .
   44 
   45 periodo:latestYear a owl:DatatypeProperty ;
   46     rdfs:comment "The latest Gregorian year referred to in the description of a temporal interval."@en ;
   47     rdfs:isDefinedBy <http://n2t.net/ark:/99152/p0v> ;
   48     rdfs:label "latest year"@en ;
   49     rdfs:domain time:DateTimeDescription ;
   50     rdfs:range xsd:gYear .
   51 
   52 time:DateTimeDescription
   53     rdfs:subClassOf [
   54         a owl:Restriction ;
   55         owl:maxCardinality "1"^^xsd:nonNegativeInteger ;
   56         owl:onProperty periodo:earliestYear
   57     ], [
   58         a owl:Restriction ;
   59         owl:maxCardinality "1"^^xsd:nonNegativeInteger ;
   60         owl:onProperty periodo:latestYear
   61     ] .
   62 
   63 periodo:PeriodShape
   64   rdf:type sh:NodeShape ;
   65   rdfs:label "Period shape" ;
   66   sh:targetClass skos:Concept ;
   67   sh:closed "true"^^xsd:boolean ;
   68   sh:ignoredProperties (
   69     rdf:type
   70     ) ;
   71   sh:pattern "^http://n2t.net/ark:/99152/p0[a-z0-9]{9}" ;
   72   sh:property
   73     periodo:PeriodPreferredLabelShape ,
   74     periodo:PeriodLocalizedLabelShape ,
   75     periodo:PeriodNoteShape ,
   76     periodo:PeriodEditorialNoteShape ,
   77     periodo:PeriodAuthorityShape ,
   78     periodo:PeriodSourceShape ,
   79     periodo:PeriodSourceIsPartOfShape ,
   80     periodo:PeriodSourceLocatorShape ,
   81     periodo:PeriodStartShape ,
   82     periodo:PeriodStopShape ,
   83     periodo:PeriodSpatialCoverageDescriptionShape ,
   84     periodo:PeriodSpatialCoverageShape ,
   85     periodo:PeriodSameAsShape ,
   86     periodo:PeriodDerivedFromShape ,
   87     periodo:PeriodBroaderShape ,
   88     periodo:PeriodURLShape ,
   89     periodo:PeriodLanguageTagShape ,
   90     periodo:PeriodLanguageShape ,
   91     periodo:PeriodScriptShape
   92   .
   93 
   94 periodo:PeriodPreferredLabelShape
   95   rdf:type sh:PropertyShape ;
   96   sh:path skos:prefLabel ;
   97   sh:name "preferred label" ;
   98   sh:description "Name of the period as given in the source" ;
   99   sh:datatype xsd:string ;
  100   sh:minCount 1 ;
  101   sh:maxCount 1 ;
  102   sh:message "Problem with period preferred label" ;
  103   .
  104 
  105 periodo:PeriodLocalizedLabelShape
  106   rdf:type sh:PropertyShape ;
  107   sh:path skos:altLabel ;
  108   sh:name "localized label" ;
  109   sh:description "Language-specific name for the period" ;
  110   sh:datatype rdf:langString ;
  111   sh:languageIn (
  112     "ar"
  113     "bg"
  114     "ca"
  115     "cmn-Hans"
  116     "cmn-Hant"
  117     "cmn-Latn"
  118     "da"
  119     "de"
  120     "el"
  121     "en"
  122     "es"
  123     "fr"
  124     "hu"
  125     "it"
  126     "ja-Latn"
  127     "ko-Latn"
  128     "la"
  129     "mi-Latn"
  130     "mk"
  131     "nl"
  132     "ota-Arab"
  133     "pt"
  134     "ro"
  135     "scn"
  136     "sl"
  137     "sq"
  138     "sr-Cyrl"
  139     "sv"
  140     "tr"
  141     "uk"
  142     "vi"
  143     "zh-Latn"
  144     ) ;
  145   sh:minCount 1 ;
  146   sh:message "Problem with period localized label" ;
  147   .
  148 
  149 periodo:PeriodNoteShape
  150   rdf:type sh:PropertyShape ;
  151   sh:path skos:note ;
  152   sh:name "note" ;
  153   sh:description "Notes about the period taken from the source" ;
  154   sh:datatype xsd:string ;
  155   sh:maxCount 1 ;
  156   sh:message "Problem with period note" ;
  157   .
  158 
  159 periodo:PeriodEditorialNoteShape
  160   rdf:type sh:PropertyShape ;
  161   sh:path skos:editorialNote ;
  162   sh:name "editorial note" ;
  163   sh:description "Administrative or editorial notes from PeriodO curators" ;
  164   sh:datatype xsd:string ;
  165   sh:maxCount 1 ;
  166   sh:message "Problem with period editorial note" ;
  167   .
  168 
  169 periodo:PeriodAuthorityShape
  170   rdf:type sh:PropertyShape ;
  171   sh:path skos:inScheme ;
  172   sh:name "authority" ;
  173   sh:description "Authority to which this period belongs" ;
  174   sh:nodeKind sh:IRI ;
  175   sh:pattern "^http://n2t.net/ark:/99152/p0[a-z0-9]{5}" ;
  176   sh:class skos:ConceptScheme ;
  177   sh:minCount 1 ;
  178   sh:maxCount 1 ;
  179   sh:message "Problem with period link to authority" ;
  180   .
  181 
  182 periodo:PeriodSourceShape
  183   rdf:type sh:PropertyShape ;
  184   sh:path dcterms:source ;
  185   sh:name "source" ;
  186   sh:description "Bibliographic information specific to this period" ;
  187   sh:nodeKind sh:BlankNode ;
  188   sh:node periodo:SourceShape ;
  189   sh:maxCount 1 ;
  190   sh:message "Problem with period source" ;
  191   .
  192 
  193 periodo:PeriodSourceIsPartOfShape
  194   rdf:type sh:PropertyShape ;
  195   sh:path ( dcterms:source dcterms:isPartOf ) ;
  196   sh:name "source is part of" ;
  197   sh:nodeKind sh:IRI ;
  198   sh:maxCount 1 ;
  199   sh:message "Problem with period source (is part of)" ;
  200   .
  201 
  202 periodo:PeriodSourceLocatorShape
  203   rdf:type sh:PropertyShape ;
  204   sh:path ( dcterms:source bibo:locator ) ;
  205   sh:name "source locator" ;
  206   sh:datatype xsd:string ;
  207   sh:maxCount 1 ;
  208   sh:message "Problem with period source (locator)" ;
  209   .
  210 
  211 periodo:PeriodStartShape
  212   rdf:type sh:PropertyShape ;
  213   sh:path time:intervalStartedBy ;
  214   sh:name "start" ;
  215   sh:description "Start interval for the period" ;
  216   sh:nodeKind sh:BlankNode ;
  217   sh:node periodo:IntervalShape ;
  218   sh:minCount 1 ;
  219   sh:maxCount 1 ;
  220   sh:message "Problem with period start interval" ;
  221   .
  222 
  223 periodo:PeriodStopShape
  224   rdf:type sh:PropertyShape ;
  225   sh:path time:intervalFinishedBy ;
  226   sh:name "stop" ;
  227   sh:description "Stop interval for the period" ;
  228   sh:nodeKind sh:BlankNode ;
  229   sh:node periodo:IntervalShape ;
  230   sh:minCount 1 ;
  231   sh:maxCount 1 ;
  232   sh:message "Problem with period stop interval" ;
  233   .
  234 
  235 periodo:PeriodSpatialCoverageDescriptionShape
  236   rdf:type sh:PropertyShape ;
  237   sh:path periodo:spatialCoverageDescription ;
  238   sh:name "spatial coverage description" ;
  239   sh:description "Spatial extent of the period as described in the source" ;
  240   sh:datatype xsd:string ;
  241   sh:maxCount 1 ;
  242   sh:message "Problem with period spatial coverage description" ;
  243   .
  244 
  245 periodo:PeriodSpatialCoverageShape
  246   rdf:type sh:PropertyShape ;
  247   sh:path dcterms:spatial ;
  248   sh:name "spatial coverage" ;
  249   sh:description "Place (partially) within spatial extent of the period" ;
  250   sh:nodeKind sh:IRI ;
  251   sh:pattern "^http://www.wikidata.org/entity/Q[0-9]+" ;
  252 # Temporarily disabled
  253 #    sh:minCount 1 ;
  254   sh:message "Problem with period spatial coverage" ;
  255   .
  256 
  257 periodo:PeriodSameAsShape
  258   rdf:type sh:PropertyShape ;
  259   sh:path owl:sameAs ;
  260   sh:name "same as" ;
  261   sh:description "Alternative URI for this period" ;
  262   sh:nodeKind sh:IRI ;
  263   sh:message "Problem with period alternative URI (sameAs)" ;
  264   .
  265 
  266 periodo:PeriodDerivedFromShape
  267   rdf:type sh:PropertyShape ;
  268   sh:path prov:wasDerivedFrom ;
  269   sh:name "was derived from" ;
  270   sh:description "Another period from which this one was derived" ;
  271   sh:nodeKind sh:IRI ;
  272   sh:pattern "^http://n2t.net/ark:/99152/p0[a-z0-9]{9}" ;
  273   sh:message "Problem with derived from" ;
  274   .
  275 
  276 periodo:PeriodBroaderShape
  277   rdf:type sh:PropertyShape ;
  278   sh:path skos:broader ;
  279   sh:name "see broader period" ;
  280   sh:description "Another period that encompasses this one" ;
  281   sh:nodeKind sh:IRI ;
  282   sh:pattern "^http://n2t.net/ark:/99152/p0[a-z0-9]{9}" ;
  283   sh:maxCount 1 ;
  284   sh:message "Problem with period broader" ;
  285   .
  286 
  287 periodo:PeriodURLShape
  288   rdf:type sh:PropertyShape ;
  289   sh:path foaf:page ;
  290   sh:name "url" ;
  291   sh:description "Web resource with information about this period" ;
  292   sh:nodeKind sh:IRI ;
  293   sh:message "Problem with period URL" ;
  294   .
  295 
  296 periodo:PeriodLanguageTagShape
  297   rdf:type sh:PropertyShape ;
  298   sh:path dce:language ;
  299   sh:name "language tag" ;
  300   sh:description "Language tag of the preferred label for this period" ;
  301   sh:datatype xsd:string ;
  302   sh:in (
  303     "ar"
  304     "bg"
  305     "ca"
  306     "cmn-Hans"
  307     "cmn-Hant"
  308     "cmn-Latn"
  309     "da"
  310     "de"
  311     "el"
  312     "en"
  313     "es"
  314     "fr"
  315     "hu"
  316     "it"
  317     "ja-Latn"
  318     "ko-Latn"
  319     "la"
  320     "mi-Latn"
  321     "mk"
  322     "nl"
  323     "ota-Arab"
  324     "pt"
  325     "ro"
  326     "scn"
  327     "sl"
  328     "sq"
  329     "sr-Cyrl"
  330     "sv"
  331     "tr"
  332     "uk"
  333     "vi"
  334     "zh-Latn"
  335     ) ;
  336   sh:minCount 1 ;
  337   sh:maxCount 1 ;
  338   sh:message "Problem with period language tag" ;
  339   .
  340 
  341 periodo:PeriodLanguageShape
  342   rdf:type sh:PropertyShape ;
  343   sh:path dcterms:language ;
  344   sh:name "language" ;
  345   sh:description "Language of the preferred label for this period" ;
  346   sh:nodeKind sh:IRI ;
  347   sh:pattern "^http://lexvo.org/id/iso639-[13]/[a-z]{2,3}" ;
  348   sh:minCount 1 ;
  349   sh:maxCount 1 ;
  350   sh:message "Problem with period language" ;
  351   .
  352 
  353 periodo:PeriodScriptShape
  354   rdf:type sh:PropertyShape ;
  355   sh:path lvont:inScript ;
  356   sh:name "script" ;
  357   sh:description "Script of the preferred label for this period" ;
  358   sh:nodeKind sh:IRI ;
  359   sh:pattern "^http://lexvo.org/id/script/[A-Z][a-z]{3}" ;
  360   sh:maxCount 1 ;
  361   sh:message "Problem with period script" ;
  362   .
  363 
  364 periodo:SourceShape
  365   rdf:type sh:NodeShape ;
  366   rdfs:label "Source shape" ;
  367   sh:closed "true"^^xsd:boolean ;
  368   sh:ignoredProperties (
  369     rdf:type
  370     ) ;
  371   sh:property
  372     periodo:SourceIsPartOfShape ,
  373     periodo:SourceTitleShape ,
  374     periodo:SourceIssuedShape ,
  375     periodo:SourceDateShape ,
  376     periodo:SourceCreatorShape ,
  377     periodo:SourceContributorShape ,
  378     periodo:SourceAbstractShape ,
  379     periodo:SourceLocatorShape ,
  380     periodo:SourceEditorialNoteShape ,
  381     periodo:SourceSameAsShape ,
  382     periodo:SourceURLShape
  383   .
  384 
  385 periodo:SourceIsPartOfShape
  386   rdf:type sh:PropertyShape ;
  387   sh:path dcterms:isPartOf ;
  388   sh:name "is part of" ;
  389   sh:nodeKind sh:BlankNodeOrIRI ;
  390   sh:maxCount 1 ;
  391   .
  392 
  393 periodo:SourceTitleShape
  394   rdf:type sh:PropertyShape ;
  395   sh:path dcterms:title ;
  396   sh:name "title" ;
  397   sh:datatype xsd:string ;
  398   sh:maxCount 1 ;
  399   .
  400 
  401 periodo:SourceIssuedShape
  402   rdf:type sh:PropertyShape ;
  403   sh:path dcterms:issued ;
  404   sh:name "issued" ;
  405   sh:datatype xsd:string ;
  406   sh:maxCount 1 ;
  407   .
  408 
  409 periodo:SourceDateShape
  410   rdf:type sh:PropertyShape ;
  411   sh:path dcterms:date ;
  412   sh:name "date" ;
  413   sh:datatype xsd:date ;
  414   sh:maxCount 1 ;
  415   .
  416 
  417 periodo:SourceCreatorShape
  418   rdf:type sh:PropertyShape ;
  419   sh:path dcterms:creator ;
  420   sh:name "creator" ;
  421   sh:nodeKind sh:BlankNodeOrIRI ;
  422   .
  423 
  424 periodo:SourceContributorShape
  425   rdf:type sh:PropertyShape ;
  426   sh:path dcterms:contributor ;
  427   sh:name "contributor" ;
  428   sh:nodeKind sh:BlankNodeOrIRI ;
  429   .
  430 
  431 periodo:SourceAbstractShape
  432   rdf:type sh:PropertyShape ;
  433   sh:path dcterms:abstract ;
  434   sh:name "abstract" ;
  435   sh:datatype xsd:string ;
  436   sh:maxCount 1 ;
  437   .
  438 
  439 periodo:SourceLocatorShape
  440   rdf:type sh:PropertyShape ;
  441   sh:path bibo:locator ;
  442   sh:name "locator" ;
  443   sh:datatype xsd:string ;
  444   sh:maxCount 1 ;
  445   .
  446 
  447 periodo:SourceEditorialNoteShape
  448   rdf:type sh:PropertyShape ;
  449   sh:path skos:editorialNote ;
  450   sh:name "editorial note" ;
  451   sh:description "Administrative or editorial notes from PeriodO curators" ;
  452   sh:datatype xsd:string ;
  453   sh:maxCount 1 ;
  454   .
  455 
  456 periodo:SourceSameAsShape
  457   rdf:type sh:PropertyShape ;
  458   sh:path owl:sameAs ;
  459   sh:name "same as" ;
  460   sh:description "External URI for this source" ;
  461   sh:nodeKind sh:IRI ;
  462   .
  463 
  464 periodo:SourceURLShape
  465   rdf:type sh:PropertyShape ;
  466   sh:path foaf:page ;
  467   sh:name "url" ;
  468   sh:description "Web resource with information about this source" ;
  469   sh:nodeKind sh:IRI ;
  470   .
  471 
  472 periodo:AuthorityShape
  473   rdf:type sh:NodeShape ;
  474   rdfs:label "Period authority shape" ;
  475   sh:targetClass skos:ConceptScheme ;
  476   sh:closed "true"^^xsd:boolean ;
  477   sh:ignoredProperties (
  478     rdf:type
  479     ) ;
  480   sh:pattern "^http://n2t.net/ark:/99152/p0[a-z0-9]{5}" ;
  481   sh:property
  482     periodo:AuthoritySourceShape ,
  483     periodo:AuthorityEditorialNoteShape ,
  484     periodo:AuthoritySameAsShape
  485   .
  486 
  487 periodo:AuthoritySourceShape
  488   rdf:type sh:PropertyShape ;
  489   sh:path dcterms:source ;
  490   sh:name "source" ;
  491   sh:description "Bibliographic description of the source" ;
  492   sh:nodeKind sh:BlankNodeOrIRI ;
  493   sh:node periodo:SourceShape ;
  494   sh:minCount 1 ;
  495   sh:maxCount 1 ;
  496   sh:message "Problem with authority source" ;
  497   .
  498 
  499 periodo:AuthorityEditorialNoteShape
  500   rdf:type sh:PropertyShape ;
  501   sh:path skos:editorialNote ;
  502   sh:name "editorial note" ;
  503   sh:description "Administrative or editorial notes from PeriodO curators" ;
  504   sh:datatype xsd:string ;
  505   sh:maxCount 1 ;
  506   sh:message "Problem with authority editorial note" ;
  507   .
  508 
  509 periodo:AuthoritySameAsShape
  510   rdf:type sh:PropertyShape ;
  511   sh:path owl:sameAs ;
  512   sh:name "same as" ;
  513   sh:description "Alternative URI for this authority" ;
  514   sh:nodeKind sh:IRI ;
  515   sh:message "Problem with authority alternative URI (sameAs)" ;
  516   .
  517 
  518 periodo:DatasetShape
  519   rdf:type sh:NodeShape ;
  520   rdfs:label "PeriodO dataset shape" ;
  521   sh:targetNode <p0d/#authorities> ;
  522   sh:closed "true"^^xsd:boolean ;
  523   sh:property
  524     periodo:DatasetTypeShape ,
  525     periodo:DatasetMemberShape ,
  526     periodo:DatasetIsPrimaryTopicOfShape
  527   .
  528 
  529 periodo:DatasetTypeShape
  530   rdf:type sh:PropertyShape ;
  531   sh:path rdf:type ;
  532   sh:name "type" ;
  533   sh:description "RDF type of this dataset" ;
  534   sh:nodeKind sh:IRI ;
  535 # Temporarily disabled
  536 #  sh:hasValue rdf:Bag ;
  537   sh:minCount 1 ;
  538   sh:maxCount 1 ;
  539   sh:message "Problem with dataset type" ;
  540   .
  541 
  542 periodo:DatasetMemberShape
  543   rdf:type sh:PropertyShape ;
  544   sh:path rdfs:member ;
  545   sh:name "member" ;
  546   sh:description "A period authority in this dataset" ;
  547   sh:nodeKind sh:IRI ;
  548   sh:pattern "^http://n2t.net/ark:/99152/p0[a-z0-9]{5}" ;
  549   sh:class skos:ConceptScheme ;
  550   sh:message "Problem with dataset member" ;
  551   .
  552 
  553 periodo:DatasetIsPrimaryTopicOfShape
  554   rdf:type sh:PropertyShape ;
  555   sh:path foaf:isPrimaryTopicOf ;
  556   sh:name "is primary topic of" ;
  557   sh:description "Link to JSON representation of this dataset" ;
  558   sh:nodeKind sh:IRI ;
  559   sh:hasValue <p0d.json> ;
  560   sh:minCount 1 ;
  561   sh:maxCount 1 ;
  562   sh:message "Problem with dataset link to JSON representation" ;
  563   .
  564 
  565 periodo:IntervalShape
  566   rdf:type sh:NodeShape ;
  567   rdfs:label "Interval shape" ;
  568   sh:closed "true"^^xsd:boolean ;
  569   sh:ignoredProperties (
  570     rdf:type
  571     ) ;
  572   sh:property
  573     periodo:IntervalPreferredLabelShape ,
  574     periodo:IntervalDateTimeDescriptionShape
  575   .
  576 
  577 periodo:IntervalPreferredLabelShape
  578   rdf:type sh:PropertyShape ;
  579   sh:path skos:prefLabel ;
  580   sh:name "preferred label" ;
  581   sh:description "Description of the interval as given in the source" ;
  582   sh:datatype xsd:string ;
  583   sh:minCount 1 ;
  584   sh:maxCount 1 ;
  585   .
  586 
  587 periodo:IntervalDateTimeDescriptionShape
  588   rdf:type sh:PropertyShape ;
  589   sh:path time:hasDateTimeDescription ;
  590   sh:name "date-time description" ;
  591   sh:description "Bibliographic description of the source" ;
  592   sh:nodeKind sh:BlankNode ;
  593   sh:node periodo:DateTimeDescriptionShape ;
  594 # Temporarily disabled
  595 #  sh:minCount 1 ;
  596   sh:maxCount 1 ;
  597   .
  598 
  599 periodo:DateTimeDescriptionShape
  600   rdf:type sh:NodeShape ;
  601   rdfs:label "Date-time description shape" ;
  602   sh:closed "true"^^xsd:boolean ;
  603   sh:ignoredProperties (
  604     rdf:type
  605     ) ;
  606   sh:property
  607     periodo:DateTimeDescriptionYearShape ,
  608     periodo:DateTimeDescriptionEarliestYearShape ,
  609     periodo:DateTimeDescriptionLatestYearShape
  610   ;
  611   sh:sparql
  612     periodo:DateTimeDescriptionMustHaveYearOrEarliestYear ,
  613     periodo:DateTimeDescriptionCannotHaveBothYearAandEarliestYear ,
  614     periodo:DateTimeDescriptionEarliestYearMustBeLessThanLatestYear
  615   .
  616 
  617 periodo:DateTimeDescriptionYearShape
  618   rdf:type sh:PropertyShape ;
  619   sh:path time:year ;
  620   sh:name "year" ;
  621   sh:description "Gregorian calendar year" ;
  622   sh:pattern "^-?([1-9][0-9]{3,}|0[0-9]{3})$" ;
  623   sh:maxCount 1 ;
  624   sh:message "At most 1 valid gYear" ;
  625   .
  626 
  627 periodo:DateTimeDescriptionEarliestYearShape
  628   rdf:type sh:PropertyShape ;
  629   sh:path periodo:earliestYear ;
  630   sh:name "earliest year" ;
  631   sh:description "earliest Gregorian calendar year" ;
  632   sh:pattern "^-?([1-9][0-9]{3,}|0[0-9]{3})$" ;
  633   sh:maxCount 1 ;
  634   sh:message "At most 1 valid gYear" ;
  635   .
  636 
  637 periodo:DateTimeDescriptionLatestYearShape
  638   rdf:type sh:PropertyShape ;
  639   sh:path periodo:latestYear ;
  640   sh:name "latest year" ;
  641   sh:description "latest Gregorian calendar year" ;
  642   sh:pattern "^-?([1-9][0-9]{3,}|0[0-9]{3})$" ;
  643   sh:maxCount 1 ;
  644   sh:message "At most 1 valid gYear" ;
  645   .
  646 
  647 periodo:DateTimeDescriptionMustHaveYearOrEarliestYear
  648   rdf:type sh:SPARQLConstraint ;
  649   sh:message "Must have either a year or an earliestYear" ;
  650   sh:prefixes <> ;
  651   sh:select """
  652 SELECT $this ($this AS ?path) ?value
  653 WHERE {
  654   ?interval time:hasDateTimeDescription $this .
  655   ?interval skos:prefLabel ?value .
  656   FILTER NOT EXISTS {
  657     { $this time:year ?year }
  658     UNION
  659     { $this periodo:earliestYear ?earliestYear }
  660   }
  661 }
  662 """
  663   .
  664 
  665 periodo:DateTimeDescriptionCannotHaveBothYearAandEarliestYear
  666   rdf:type sh:SPARQLConstraint ;
  667   sh:message "Cannot have both a year and an earliestYear" ;
  668   sh:prefixes <> ;
  669   sh:select """
  670 SELECT $this ($this AS ?path) ?value
  671 WHERE {
  672   ?interval time:hasDateTimeDescription $this .
  673   ?interval skos:prefLabel ?value .
  674   $this time:year ?year .
  675   $this periodo:earliestYear ?earliestYear
  676 }
  677 """
  678   .
  679 
  680 periodo:DateTimeDescriptionEarliestYearMustBeLessThanLatestYear
  681   rdf:type sh:SPARQLConstraint ;
  682   sh:message "earliestYear must be less than latestYear" ;
  683   sh:prefixes <> ;
  684   sh:select """
  685 SELECT $this ($this AS ?path) ?value
  686 WHERE {
  687   ?interval time:hasDateTimeDescription $this .
  688   ?interval skos:prefLabel ?value .
  689   $this periodo:earliestYear ?earliestYear .
  690   $this periodo:latestYear ?latestYear .
  691   FILTER (xsd:long(?earliestYear) >= xsd:long(?latestYear))
  692 }
  693 """
  694   .
  695 
  696 # prefix declarations for SPARQL constraint queries
  697 <>
  698   sh:declare [
  699     sh:prefix "periodo" ;
  700     sh:namespace "http://n2t.net/ark:/99152/p0v#"^^xsd:anyURI ;
  701     ] ;
  702   sh:declare [
  703     sh:prefix "time" ;
  704     sh:namespace "http://www.w3.org/2006/time#"^^xsd:anyURI ;
  705     ] ;
  706   sh:declare [
  707     sh:prefix "skos" ;
  708     sh:namespace "http://www.w3.org/2004/02/skos/core#"^^xsd:anyURI ;
  709     ] ;
  710   sh:declare [
  711     sh:prefix "xsd" ;
  712     sh:namespace "http://www.w3.org/2001/XMLSchema#"^^xsd:anyURI ;
  713     ] ;
  714   .