-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathObservationConstraint.ttl
More file actions
92 lines (81 loc) · 2.74 KB
/
ObservationConstraint.ttl
File metadata and controls
92 lines (81 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#### These are SHACL shapes for the SOSA ontology ####
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix sosa-shacl: <http://stko-kwg.geog.ucsb.ed/sosa-shacl/> .
@prefix time: <http://www.w3.org/2006/time#> .
### Shapes for class sosa:Observation
sosa-shacl:ObservationConstraint
a sh:NodeShape ;
sh:targetClass sosa:Observation ;
sh:property [
sh:path sosa:madeBySensor ;
rdfs:comment "An Observation is made by at most one sensor and the sensor can be implicit (unknown)."@en ;
sh:maxCount 1 ;
sh:class sosa:Sensor ;
] ;
sh:property [
sh:path sosa:usedProcedure ;
rdfs:comment "An Observation is only made via a Procedure."@en ;
sh:class sosa:Procedure ;
] ;
sh:property [
sh:path sosa:hasFeatureOfInterest ;
rdfs:comment "An Observation is made on exactly one feature of interest."@en ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:class sosa:FeatureOfInterest ;
] ;
sh:property [
sh:path sosa:observedProperty ;
rdfs:comment "An Observation is about exactly one obervable property."@en ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:class sosa:ObservableProperty ;
] ;
sh:property [
sh:path ssn:wasOriginatedBy ;
rdfs:comment "An Observation is originated from at most one stimulus and the stimulus can be implicit (unknown)."@en ;
sh:maxCount 1 ;
sh:class ssn:Stimulus ;
] ;
sh:property [
rdfs:comment "An Observation has to have at most one phenomenon time."@en ;
sh:path sosa:phenomenonTime ;
sh:maxCount 1 ;
sh:class time:TemporalEntity ;
] ;
sh:property [
rdfs:comment "An Observation has to have at most one result time."@en ;
sh:path sosa:resultTime ;
sh:maxCount 1 ;
sh:datatype time:dateTime ;
] .
# sh:or (
# sh:property [
# rdfs:comment "An Observation has to have at least one phenomenon time or result time."@en ;
# sh:path sosa:phenomenonTime ;
# sh:minCount 1 ;
# ]
# sh:property [
# rdfs:comment "An Observation has to have at least one phenomenon time or result time."@en ;
# sh:path sosa:resultTime ;
# sh:minCount 1 ;
# ]
# ) ;
# sh:sparql [
# sh:message "Result time has to be later than the phenomenon time." ;
# sh:select """
# SELECT $this (sosa:phenomenonTime AS ?path) ?phenTime_literal
# WHERE {
# $this sosa:phenomenonTime ?phenTime ;
# sosa:resultTime ?resultTime_literal .
# ?phenTime time:hasBeginning ?phenTime_obj .
# ?phenTime_obj time:inXSDDateTime ?phenTime_literal .
# FILTER (?phenTime_literal < ?resultTime_literal)
# }
# """ ;
# ] .