Data:Device
Revision as of 05:18, 16 February 2017 by Karima Rafes (talk | contribs)
Prefix
PREFIX daapSch: <http://daap.eu/wiki/Schema:>
PREFIX daapProp: <http://daap.eu/wiki/Property:>
PREFIX daap: <http://daap.eu/wiki/>
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 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 wd: <http://www.wikidata.org/entity/> .
#@prefix world: <http://daap.eu/ontology/2015/world#> .
#@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
RDFS
daap:Device
a owl:Class ;
rdfs:label "Device"@en ;
rdfs:label "Instrument"@fr ;
rdfs:subClassOf owl:Thing.
SHACL
Target
daap:Device
a sh:Shape ;
sh:targetClass daap:Device . # Applies to all devices
Property
daap:Device
sh:property [
rdfs:label "Pilot process"@en ;
rdfs:label "Responsable de l'appareil"@fr ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:predicate daapProp:pilotProcess ;
sh:valueClass daap:Individual ;
];
sh:property [
rdfs:label "check by"^^xsd:string ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:predicate daapProp:checkBy ;
sh:valueClass daap:Individual ;
] ;
sh:property [
rdfs:label "Wikidata item"^^xsd:string ;
sh:nodeKind sh:IRI ;
sh:predicate daapProp:item ;
sh:valueClass <http://wikiba.se/ontology#Item> ;
] ;
sh:property [
rdfs:label "latitude"^^xsd:string ;
sh:datatype xsd:float ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:predicate geo:lat ;
] ;
sh:property [
rdfs:label "longitude"^^xsd:string ;
sh:datatype xsd:float ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:predicate geo:long ;
] ;
sh:property [
rdfs:label "organization-unit"^^xsd:string ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:predicate vcard:organization-unit ;
sh:valueClass vcard:Organization ;
] ;
sh:property [
rdfs:label "picture"^^xsd:string ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:predicate <http://daap.eu/wiki/Property:picture> ;
sh:valueClass rdfs:Resource ;
]
.
Contraint
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) )
} """
]
.