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