Difference between revisions of "Data:Device"

From DAAP
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Prefix ==
 
== Prefix ==
<rdf contraint=shacl>
+
<rdf>
PREFIX daapSch: <http://daap.eu/wiki/Schema:>
+
BASE <http://daap.dsi.universite-paris-saclay.fr/wiki/Data:Device#>
PREFIX daapProp: <http://daap.eu/wiki/Property:>
+
 
PREFIX daap: <http://daap.eu/wiki/>  
+
prefix daapo: <http://daap.dsi.universite-paris-saclay.fr/wiki/Data:Organization#>  
 
</rdf>
 
</rdf>
 
  
 
<rdf>
 
<rdf>
Line 14: Line 13:
 
PREFIX owl: <http://www.w3.org/2002/07/owl#>  
 
PREFIX owl: <http://www.w3.org/2002/07/owl#>  
 
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>  
 
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>  
 
#@prefix maintenance: <http://daap.eu/ontology/2015/maintenance#> .
 
#@prefix organisation: <http://daap.eu/ontology/2015/organisation#> .
 
#@prefix sp: <http://spinrdf.org/sp#> .
 
#@prefix spin: <http://spinrdf.org/spin#> .
 
#@prefix spl: <http://spinrdf.org/spl#> .
 
 
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>  
 
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>  
#@prefix wd: <http://www.wikidata.org/entity/> .
 
#@prefix world: <http://daap.eu/ontology/2015/world#> .
 
#@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 
 
</rdf>
 
</rdf>
  
== RDFS ==
+
== Definition ==
 +
 
 +
The class Device contains 7 properties.
 
<rdf>
 
<rdf>
daap:Device
+
<Device>
   a owl:Class ;
+
   a rdfs:Class ;
 
   rdfs:label "Device"@en ;
 
   rdfs:label "Device"@en ;
 
   rdfs:label "Instrument"@fr ;
 
   rdfs:label "Instrument"@fr ;
Line 35: Line 27:
 
</rdf>
 
</rdf>
  
== SHACL ==
+
<rdf constraint="shacl">
=== Target ===
+
<Device>
<rdf>
+
   a sh:NodeShape ;
daap:Device  
+
   sh:targetClass <Device> ;   # Applies to all devices
   a sh:Shape ;
+
  sh:property [
   sh:targetClass daap:Device .   # Applies to all devices
+
sh:path rdfs:label ;
</rdf>
+
sh:datatype xsd:string ;
 
+
sh:minCount 2 ; #fr and en
=== Property ===
+
sh:uniqueLang true ;
<rdf>
+
  ] ;
daap:Device
 
 
   sh:property [
 
   sh:property [
 
       rdfs:label "Pilot process"@en ;
 
       rdfs:label "Pilot process"@en ;
Line 51: Line 42:
 
       sh:minCount 1 ;
 
       sh:minCount 1 ;
 
       sh:nodeKind sh:IRI ;
 
       sh:nodeKind sh:IRI ;
       sh:predicate daapProp:pilotProcess ;
+
       sh:path <pilotProcess> ;
       sh:valueClass daap:Individual ;
+
       sh:class daapo:Individual ;
 
     ];  
 
     ];  
 
   sh:property [
 
   sh:property [
Line 58: Line 49:
 
       sh:minCount 1 ;
 
       sh:minCount 1 ;
 
       sh:nodeKind sh:IRI ;
 
       sh:nodeKind sh:IRI ;
       sh:predicate daapProp:checkBy ;
+
       sh:path <checkBy> ;
       sh:valueClass daap:Individual ;
+
       sh:class daapo:Individual ;
 
     ] ;
 
     ] ;
 
   sh:property [
 
   sh:property [
 
       rdfs:label "Wikidata item"^^xsd:string ;
 
       rdfs:label "Wikidata item"^^xsd:string ;
 
       sh:nodeKind sh:IRI ;
 
       sh:nodeKind sh:IRI ;
       sh:predicate daapProp:item ;
+
       sh:path <item> ;
      sh:valueClass <http://wikiba.se/ontology#Item> ;
+
#      sh:class <http://wikiba.se/ontology#Item> ;
 
     ] ;
 
     ] ;
 
   sh:property [
 
   sh:property [
Line 72: Line 63:
 
       sh:maxCount 1 ;
 
       sh:maxCount 1 ;
 
       sh:minCount 1 ;
 
       sh:minCount 1 ;
       sh:predicate geo:lat ;
+
       sh:path geo:lat ;
 
     ] ;
 
     ] ;
 
   sh:property [
 
   sh:property [
Line 79: Line 70:
 
       sh:maxCount 1 ;
 
       sh:maxCount 1 ;
 
       sh:minCount 1 ;
 
       sh:minCount 1 ;
       sh:predicate geo:long ;
+
       sh:path geo:long ;
 
     ] ;
 
     ] ;
 
   sh:property [
 
   sh:property [
Line 86: Line 77:
 
       sh:minCount 1 ;
 
       sh:minCount 1 ;
 
       sh:nodeKind sh:IRI ;
 
       sh:nodeKind sh:IRI ;
       sh:predicate vcard:organization-unit ;
+
       sh:path vcard:organization-unit ;
       sh:valueClass vcard:Organization ;
+
       sh:class vcard:Organization ;
 
     ] ;
 
     ] ;
 
   sh:property [
 
   sh:property [
Line 94: Line 85:
 
       sh:minCount 1 ;
 
       sh:minCount 1 ;
 
       sh:nodeKind sh:IRI ;
 
       sh:nodeKind sh:IRI ;
       sh:predicate <http://daap.eu/wiki/Property:picture> ;
+
       sh:path <picture> ;
      sh:valueClass rdfs:Resource ;
 
    ]
 
.
 
</rdf>
 
 
 
=== Contraint ===
 
[[Category:Maintenance Shacl]]
 
<rdf>
 
daap:Device
 
  sh:constraint [
 
      sh:message "Check if the fields exist :  (label (en))"^^xsd:string ;
 
      sh:predicate daap:checkDevice ;
 
      sh:sparql """prefix daap: <http://daap.eu/wiki/>
 
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 
 
 
select ?this (?this AS ?subject) (?this AS ?object)
 
where {
 
?this rdf:type daap:Device .
 
        OPTIONAL {
 
              ?this rdfs:label ?label .
 
              FILTER langMatches( lang(?label), \"EN\" )
 
        }       
 
    FILTER ( ! bound(?label) )
 
} """
 
 
     ]  
 
     ]  
 
.
 
.
 
</rdf>
 
</rdf>

Latest revision as of 07:51, 15 November 2021

Prefix

BASE <http://daap.dsi.universite-paris-saclay.fr/wiki/Data:Device#>

prefix daapo: <http://daap.dsi.universite-paris-saclay.fr/wiki/Data:Organization#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#> 
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> 
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

Definition

The class Device contains 7 properties.

<Device>
  a rdfs:Class ;
  rdfs:label "Device"@en ;
  rdfs:label "Instrument"@fr ;
  rdfs:subClassOf owl:Thing.
<Device>
  a sh:NodeShape ;
  sh:targetClass <Device> ;    # Applies to all devices
   sh:property [
	sh:path rdfs:label ;
	sh:datatype xsd:string ;
	sh:minCount 2 ; #fr and en
	sh:uniqueLang true ;
   ] ;
  sh:property [
      rdfs:label "Pilot process"@en ;
      rdfs:label "Responsable de l'appareil"@fr ;
      sh:minCount 1 ;
      sh:nodeKind sh:IRI ;
      sh:path <pilotProcess> ;
      sh:class daapo:Individual ;
    ]; 
   sh:property [
      rdfs:label "check by"^^xsd:string ;
      sh:minCount 1 ;
      sh:nodeKind sh:IRI ;
      sh:path <checkBy> ;
      sh:class daapo:Individual ;
    ] ;
  sh:property [
      rdfs:label "Wikidata item"^^xsd:string ;
      sh:nodeKind sh:IRI ;
      sh:path <item> ;
#      sh:class <http://wikiba.se/ontology#Item> ;
    ] ;
  sh:property [
      rdfs:label "latitude"^^xsd:string ;
      sh:datatype xsd:float ;
      sh:maxCount 1 ;
      sh:minCount 1 ;
      sh:path geo:lat ;
    ] ;
  sh:property [
      rdfs:label "longitude"^^xsd:string ;
      sh:datatype xsd:float ;
      sh:maxCount 1 ;
      sh:minCount 1 ;
      sh:path geo:long ;
    ] ;
  sh:property [
      rdfs:label "organization-unit"^^xsd:string ;
      sh:maxCount 1 ;
      sh:minCount 1 ;
      sh:nodeKind sh:IRI ;
      sh:path vcard:organization-unit ;
      sh:class vcard:Organization ;
    ] ;
  sh:property [
      rdfs:label "picture"^^xsd:string ;
      sh:maxCount 1 ;
      sh:minCount 1 ;
      sh:nodeKind sh:IRI ;
      sh:path <picture> ;
    ] 
.