Skip to content

Commit e66c6fd

Browse files
committed
Merge remote-tracking branch 'origin/devel' into indigo-devel
2 parents 358cc8f + f7f42c7 commit e66c6fd

File tree

4 files changed

+115
-70
lines changed

4 files changed

+115
-70
lines changed

knowrob_common/owl/knowrob.owl

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,29 @@
8686
///////////////////////////////////////////////////////////////////////////////////////
8787
-->
8888

89-
<!-- http://knowrob.org/kb/knowrob.owl#belongsToUser -->
90-
9189
<owl:ObjectProperty rdf:about="&knowrob;belongsToUser">
92-
<rdfs:range rdf:resource="&knowrob;Thing"/>
93-
<rdfs:domain rdf:resource="&knowrob;Person"/>
90+
<rdfs:range rdf:resource="&knowrob;Person"/>
91+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
92+
</owl:ObjectProperty>
93+
94+
<owl:ObjectProperty rdf:about="&knowrob;imageFilePath">
95+
<rdfs:range rdf:resource="&xsd;string"/>
96+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
97+
</owl:ObjectProperty>
98+
99+
<owl:ObjectProperty rdf:about="&knowrob;imageCreationTimestamp">
100+
<rdfs:range rdf:resource="&xsd;int"/>
101+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
102+
</owl:ObjectProperty>
103+
104+
<owl:ObjectProperty rdf:about="&knowrob;caffeClass">
105+
<rdfs:range rdf:resource="&xsd;string"/>
106+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
94107
</owl:ObjectProperty>
95108

96109
<owl:ObjectProperty rdf:about="&knowrob;hasFallen">
97110
<rdfs:range rdf:resource="&knowrob;Fall"/>
98-
<rdfs:domain rdf:resource="&knowrob;Patient"/>
111+
<rdfs:domain rdf:resource="&knowrob;Person"/>
99112
</owl:ObjectProperty>
100113

101114
<owl:ObjectProperty rdf:about="&knowrob;humanMessageType">
@@ -110,9 +123,6 @@
110123
<rdfs:domain rdf:resource="&knowrob;Agent-Generic"/>
111124
</owl:ObjectProperty>
112125

113-
114-
115-
116126
<owl:ObjectProperty rdf:about="&knowrob;cognitiveTestVariation">
117127
<rdfs:range rdf:resource="&xsd;int"/>
118128
<rdfs:domain rdf:resource="&knowrob;CognitiveTests"/>
@@ -128,11 +138,8 @@
128138
<rdfs:domain rdf:resource="&knowrob;CognitiveTests"/>
129139
</owl:ObjectProperty>
130140

131-
<!--warning, I did not create a cognitiveTestSubType attribute -->
132-
133-
134141
<owl:ObjectProperty rdf:about="&knowrob;cognitiveTestPerformedPatient">
135-
<rdfs:range rdf:resource="&knowrob;Patient"/>
142+
<rdfs:range rdf:resource="&knowrob;Person"/>
136143
<rdfs:domain rdf:resource="&knowrob;CognitiveTestPerformed"/>
137144
</owl:ObjectProperty>
138145

@@ -151,12 +158,6 @@
151158
<rdfs:domain rdf:resource="&knowrob;CognitiveTestPerformed"/>
152159
</owl:ObjectProperty>
153160

154-
155-
156-
157-
158-
159-
160161
<!--
161162
///////////////////////////////////////////////////////////////////////////////////////
162163
//
@@ -9845,6 +9846,16 @@ Note that a fictional or imaginary object (such as Frodo, Captain Queeg, or HAL9
98459846
</owl:Class>
98469847

98479848

9849+
<!-- http://knowrob.org/kb/knowrob.owl#SpatialThing-Localized -->
9850+
9851+
<owl:Class rdf:about="&knowrob;SpatialThing-Localized-Unspecified">
9852+
<rdfs:subClassOf rdf:resource="&knowrob;SpatialThing"/>
9853+
<rdfs:comment rdf:datatype="&xsd;string">A specialization of both SpatialThing and TemporalThing. This is the collection of all spatial things, tangible or intangible, that can meaningfully be said to have location or position in the empirical universe.
9854+
9855+
Examples of spatially-localized things include all PartiallyTangible things, such as trees and ships, as well as certain Intangible spatial things, like the EarthsEquator. Also included are those events that can be pinned-down to specific places (see Event-Localized), and thus all PhysicalEvents. Excluded from this collection are any SpatialThings that are not localized, such as -- arguably -- purely abstract geometrical figures (e.g. a Platonic sphere).
9856+
9857+
Note that a fictional or imaginary object (such as Frodo, Captain Queeg, or HAL9000-TheComputer) is typically localized with respect to the universe of the fictional/imagnary context in which it is found, and so is an instance of SpatialThing-Localized with respect to that context.</rdfs:comment>
9858+
</owl:Class>
98489859

98499860
<!-- http://knowrob.org/kb/knowrob.owl#SpatialThingTypeByShape -->
98509861

knowrob_common/owl/knowrob.owl~

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,29 @@
8686
///////////////////////////////////////////////////////////////////////////////////////
8787
-->
8888

89-
<!-- http://knowrob.org/kb/knowrob.owl#belongsToUser -->
90-
9189
<owl:ObjectProperty rdf:about="&knowrob;belongsToUser">
92-
<rdfs:range rdf:resource="&knowrob;Thing"/>
93-
<rdfs:domain rdf:resource="&knowrob;Person"/>
90+
<rdfs:range rdf:resource="&knowrob;Person"/>
91+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
92+
</owl:ObjectProperty>
93+
94+
<owl:ObjectProperty rdf:about="&knowrob;imageFilePath">
95+
<rdfs:range rdf:resource="&xsd;string"/>
96+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
97+
</owl:ObjectProperty>
98+
99+
<owl:ObjectProperty rdf:about="&knowrob;imageCreationTimestamp">
100+
<rdfs:range rdf:resource="&xsd;int"/>
101+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
102+
</owl:ObjectProperty>
103+
104+
<owl:ObjectProperty rdf:about="&knowrob;caffeClass">
105+
<rdfs:range rdf:resource="&xsd;string"/>
106+
<rdfs:domain rdf:resource="&knowrob;SpatialThing"/>
94107
</owl:ObjectProperty>
95108

96109
<owl:ObjectProperty rdf:about="&knowrob;hasFallen">
97110
<rdfs:range rdf:resource="&knowrob;Fall"/>
98-
<rdfs:domain rdf:resource="&knowrob;Patient"/>
111+
<rdfs:domain rdf:resource="&knowrob;Person"/>
99112
</owl:ObjectProperty>
100113

101114
<owl:ObjectProperty rdf:about="&knowrob;humanMessageType">
@@ -105,14 +118,11 @@
105118
</owl:ObjectProperty>
106119

107120
<owl:ObjectProperty rdf:about="&knowrob;speaksLanguage">
108-
<rdfs:range rdf:resource="&knowrob;English"/>
109-
<rdfs:range rdf:resource="&knowrob;Greek"/>
121+
<rdfs:range rdf:resource="&knowrob;en"/>
122+
<rdfs:range rdf:resource="&knowrob;el"/>
110123
<rdfs:domain rdf:resource="&knowrob;Agent-Generic"/>
111124
</owl:ObjectProperty>
112125

113-
114-
115-
116126
<owl:ObjectProperty rdf:about="&knowrob;cognitiveTestVariation">
117127
<rdfs:range rdf:resource="&xsd;int"/>
118128
<rdfs:domain rdf:resource="&knowrob;CognitiveTests"/>
@@ -128,11 +138,8 @@
128138
<rdfs:domain rdf:resource="&knowrob;CognitiveTests"/>
129139
</owl:ObjectProperty>
130140

131-
<!--warning, I did not create a cognitiveTestSubType attribute -->
132-
133-
134141
<owl:ObjectProperty rdf:about="&knowrob;cognitiveTestPerformedPatient">
135-
<rdfs:range rdf:resource="&knowrob;Patient"/>
142+
<rdfs:range rdf:resource="&knowrob;Person"/>
136143
<rdfs:domain rdf:resource="&knowrob;CognitiveTestPerformed"/>
137144
</owl:ObjectProperty>
138145

@@ -151,12 +158,6 @@
151158
<rdfs:domain rdf:resource="&knowrob;CognitiveTestPerformed"/>
152159
</owl:ObjectProperty>
153160

154-
155-
156-
157-
158-
159-
160161
<!--
161162
///////////////////////////////////////////////////////////////////////////////////////
162163
//
@@ -8074,11 +8075,11 @@ For predicates that relate things to measurable quantities that characterize the
80748075
<rdfs:subClassOf rdf:resource="&knowrob;SocialConcepts"/>
80758076
</owl:Class>
80768077

8077-
<owl:Class rdf:about="&knowrob;English">
8078+
<owl:Class rdf:about="&knowrob;en">
80788079
<rdfs:subClassOf rdf:resource="&knowrob;HumanLanguage"/>
80798080
</owl:Class>
80808081

8081-
<owl:Class rdf:about="&knowrob;Greek">
8082+
<owl:Class rdf:about="&knowrob;el">
80828083
<rdfs:subClassOf rdf:resource="&knowrob;HumanLanguage"/>
80838084
</owl:Class>
80848085

@@ -9845,6 +9846,16 @@ Note that a fictional or imaginary object (such as Frodo, Captain Queeg, or HAL9
98459846
</owl:Class>
98469847

98479848

9849+
<!-- http://knowrob.org/kb/knowrob.owl#SpatialThing-Localized -->
9850+
9851+
<owl:Class rdf:about="&knowrob;SpatialThing-Localized-Unspecified">
9852+
<rdfs:subClassOf rdf:resource="&knowrob;SpatialThing"/>
9853+
<rdfs:comment rdf:datatype="&xsd;string">A specialization of both SpatialThing and TemporalThing. This is the collection of all spatial things, tangible or intangible, that can meaningfully be said to have location or position in the empirical universe.
9854+
9855+
Examples of spatially-localized things include all PartiallyTangible things, such as trees and ships, as well as certain Intangible spatial things, like the EarthsEquator. Also included are those events that can be pinned-down to specific places (see Event-Localized), and thus all PhysicalEvents. Excluded from this collection are any SpatialThings that are not localized, such as -- arguably -- purely abstract geometrical figures (e.g. a Platonic sphere).
9856+
9857+
Note that a fictional or imaginary object (such as Frodo, Captain Queeg, or HAL9000-TheComputer) is typically localized with respect to the universe of the fictional/imagnary context in which it is found, and so is an instance of SpatialThing-Localized with respect to that context.</rdfs:comment>
9858+
</owl:Class>
98489859

98499860
<!-- http://knowrob.org/kb/knowrob.owl#SpatialThingTypeByShape -->
98509861

knowrob_common/prolog/knowrob_owl.pl

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@
4040
direct_subclassesOf_withCheck/2,
4141
direct_superclassesOf_withCheck/2,
4242
valueToAttribute_withCheck/3,
43-
userCognitiveTestPerformance/7,
44-
cognitiveTestsOfType/6,
45-
createCognitiveTest/5,
46-
cognitiveTestPerformed/7
43+
userCognitiveTestPerformance/8,
44+
cognitiveTestsOfType/7,
45+
createCognitiveTest/6,
46+
cognitiveTestPerformed/7,
47+
createObjectAndRegisterImage/6
4748
]).
4849

4950
:- use_module(library('crypt')).
@@ -68,10 +69,11 @@
6869
direct_subclassesOf_withCheck(r,r),
6970
direct_superclassesOf_withCheck(r,r),
7071
valueToAttribute_withCheck(r,r,r),
71-
userCognitiveTestPerformance(r,r,r,r,r,r,r),
72-
cognitiveTestsOfType(r,r,r,r,r,r),
73-
createCognitiveTest(r,r,r,r,r),
72+
userCognitiveTestPerformance(r,r,r,r,r,r,r,r),
73+
cognitiveTestsOfType(r,r,r,r,r,r,r),
74+
createCognitiveTest(r,r,r,r,r,r),
7475
cognitiveTestPerformed(r,r,r,r,r,r,r),
76+
createObjectAndRegisterImage(r,r,r,r,r,r),
7577
create_timepoint(+,r),
7678
get_timepoint(r),
7779
get_timepoint(+,r),
@@ -378,35 +380,45 @@
378380
rdf_has(A,rdfs:range,Cclass),
379381
rdf_assert(B,A,C).
380382

381-
userCognitiveTestPerformance(A,C,B,Dif,Timestamp,SC,P):-
383+
userCognitiveTestPerformance(A,C,B,Dif,Timestamp,SC,P,SubType):-
384+
rdf_has(A,rdf:type,knowrob:'Person'),
382385
rdf_has(P,knowrob:cognitiveTestPerformedPatient,A),
383-
rdf_has(P,knowrob:cognitiveTestPerformedTestType,B),
386+
rdf_has(P,knowrob:cognitiveTestPerformedTestName,B),
384387
rdf_has(B,rdf:type,C),
388+
rdf_has(B,knowrob:cognitiveTestSubType,SubType),
385389
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
386390
rdf_has(P,knowrob:cognitiveTestPerformedTimestamp,literal(type(_, Timestamp))),
387391
rdf_has(P,knowrob:cognitiveTestPerformedScore,literal(type(_, SC))).
388392

389-
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language):-
393+
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language,Id):-
390394
rdf_has(B,rdf:type,A),
391395
rdf_has(B,knowrob:supportedLanguages,Language),
392396
rdf_has(B,knowrob:cognitiveTestFilePath,literal(type(_, Path))),
393397
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
394-
rdf_has(B,knowrob:cognitiveTestSubType,Sub).
398+
rdf_has(B,knowrob:cognitiveTestSubType,Sub),
399+
rdf_has(B,knowrob:cognitiveTestId,literal(type(_, Id))).
395400

396-
createCognitiveTest(A,B,D,E,F):-
401+
createCognitiveTest(A,B,D,E,F,G):-
397402
owl_subclass_of(F,A),
398403
rdf_instance_from_class(A,B),
399404
rdf_assert(B,knowrob:cognitiveTestDifficulty,literal(type(xsd:string,D))),
400405
rdf_assert(B,knowrob:cognitiveTestFilePath,literal(type(xsd:string,E))),
401-
rdf_assert(B,knowrob:cognitiveTestSubType,F).
406+
rdf_assert(B,knowrob:cognitiveTestSubType,F),
407+
rdf_assert(B,knowrob:cognitiveTestId,literal(type(xsd:string,G))).
402408

403409
cognitiveTestPerformed(B,Patient,Test,Time,Score,C,D):-
404-
rdf_has(Patient,rdf:type,C),
410+
rdf_has(Patient,rdf:type,knowrob:'Person'),
405411
rdf_instance_from_class(D,B),
406412
rdf_has(Test,knowrob:cognitiveTestSubType,L),
407413
rdf_assert(B,knowrob:cognitiveTestPerformedPatient,Patient),
408-
rdf_assert(B,knowrob:cognitiveTestPerformedTestType,Test),
414+
rdf_assert(B,knowrob:cognitiveTestPerformedTestName,Test),
409415
rdf_assert(B,knowrob:cognitiveTestPerformedTimestamp,literal(type(xsd:string,Time))),
410416
rdf_assert(B,knowrob:cognitiveTestPerformedScore,literal(type(xsd:string,Score))).
411417

412-
418+
createObjectAndRegisterImage(Object,ObjectClass,Person,Time,Path,CaffeClass):-
419+
rdf_has(Person,rdf:type,knowrob:'Person'),
420+
rdf_instance_from_class(ObjectClass,Object),
421+
rdf_assert(Object,knowrob:belongsToUser,Person),
422+
rdf_assert(Object,knowrob:imageFilePath,literal(type(xsd:string,Path))),
423+
rdf_assert(Object,knowrob:imageCreationTimestamp,literal(type(xsd:string,Time))),
424+
rdf_assert(Object,knowrob:caffeClass,literal(type(xsd:string,CaffeClass))).

knowrob_common/prolog/knowrob_owl.pl~

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@
4141
direct_superclassesOf_withCheck/2,
4242
valueToAttribute_withCheck/3,
4343
userCognitiveTestPerformance/8,
44-
cognitiveTestsOfType/6,
45-
createCognitiveTest/5,
46-
cognitiveTestPerformed/7
44+
cognitiveTestsOfType/7,
45+
createCognitiveTest/6,
46+
cognitiveTestPerformed/7,
47+
createObjectAndRegisterImage/6
4748
]).
4849

4950
:- use_module(library('crypt')).
@@ -69,9 +70,10 @@
6970
direct_superclassesOf_withCheck(r,r),
7071
valueToAttribute_withCheck(r,r,r),
7172
userCognitiveTestPerformance(r,r,r,r,r,r,r,r),
72-
cognitiveTestsOfType(r,r,r,r,r,r),
73-
createCognitiveTest(r,r,r,r,r),
73+
cognitiveTestsOfType(r,r,r,r,r,r,r),
74+
createCognitiveTest(r,r,r,r,r,r),
7475
cognitiveTestPerformed(r,r,r,r,r,r,r),
76+
createObjectAndRegisterImage(r,r,r,r,r,r),
7577
create_timepoint(+,r),
7678
get_timepoint(r),
7779
get_timepoint(+,r),
@@ -378,35 +380,44 @@ valueToAttribute_withCheck(A,B,C):-
378380
rdf_has(A,rdfs:range,Cclass),
379381
rdf_assert(B,A,C).
380382

381-
userCognitiveTestPerformance(A,C,B,Var,Dif,Timestamp,SC,P):-
383+
userCognitiveTestPerformance(A,C,B,Dif,Timestamp,SC,P,SubType):-
382384
rdf_has(P,knowrob:cognitiveTestPerformedPatient,A),
383-
rdf_has(P,knowrob:cognitiveTestPerformedTestType,B),
385+
rdf_has(P,knowrob:cognitiveTestPerformedTestName,B),
384386
rdf_has(B,rdf:type,C),
387+
rdf_has(B,knowrob:cognitiveTestSubType,SubType),
385388
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
386389
rdf_has(P,knowrob:cognitiveTestPerformedTimestamp,literal(type(_, Timestamp))),
387390
rdf_has(P,knowrob:cognitiveTestPerformedScore,literal(type(_, SC))).
388391

389-
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language):-
392+
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language,Id):-
390393
rdf_has(B,rdf:type,A),
391394
rdf_has(B,knowrob:supportedLanguages,Language),
392395
rdf_has(B,knowrob:cognitiveTestFilePath,literal(type(_, Path))),
393396
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
394-
rdf_has(B,knowrob:cognitiveTestSubType,Sub).
397+
rdf_has(B,knowrob:cognitiveTestSubType,Sub),
398+
rdf_has(B,knowrob:cognitiveTestId,literal(type(_, Id))).
395399

396-
createCognitiveTest(A,B,D,E,F):-
400+
createCognitiveTest(A,B,D,E,F,G):-
397401
owl_subclass_of(F,A),
398402
rdf_instance_from_class(A,B),
399403
rdf_assert(B,knowrob:cognitiveTestDifficulty,literal(type(xsd:string,D))),
400404
rdf_assert(B,knowrob:cognitiveTestFilePath,literal(type(xsd:string,E))),
401-
rdf_assert(B,knowrob:cognitiveTestSubType,F).
405+
rdf_assert(B,knowrob:cognitiveTestSubType,F),
406+
rdf_assert(B,knowrob:cognitiveTestId,literal(type(xsd:string,G))).
402407

403408
cognitiveTestPerformed(B,Patient,Test,Time,Score,C,D):-
404-
rdf_has(Patient,rdf:type,C),
409+
rdf_has(Patient,rdf:type,knowrob:'Person'),
405410
rdf_instance_from_class(D,B),
406411
rdf_has(Test,knowrob:cognitiveTestSubType,L),
407412
rdf_assert(B,knowrob:cognitiveTestPerformedPatient,Patient),
408-
rdf_assert(B,knowrob:cognitiveTestPerformedTestType,Test),
413+
rdf_assert(B,knowrob:cognitiveTestPerformedTestName,Test),
409414
rdf_assert(B,knowrob:cognitiveTestPerformedTimestamp,literal(type(xsd:string,Time))),
410415
rdf_assert(B,knowrob:cognitiveTestPerformedScore,literal(type(xsd:string,Score))).
411416

412-
417+
createObjectAndRegisterImage(Object,ObjectClass,Person,Time,Path,CaffeClass):-
418+
rdf_has(Person,rdf:type,knowrob:'Person'),
419+
rdf_instance_from_class(ObjectClass,Object),
420+
rdf_assert(Object,knowrob:belongsToUser,Person),
421+
rdf_assert(Object,knowrob:imageFilePath,literal(type(xsd:string,Path))),
422+
rdf_assert(Object,knowrob:imageCreationTimestamp,literal(type(xsd:string,Time))),
423+
rdf_assert(Object,knowrob:caffeClass,literal(type(xsd:string,CaffeClass))).

0 commit comments

Comments
 (0)