Skip to content

Commit 358cc8f

Browse files
committed
updated owl and prolog to work with no variation and support language in cognitive exercise tests
1 parent 36fc5ba commit 358cc8f

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

knowrob_common/owl/knowrob.owl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105
</owl:ObjectProperty>
106106

107107
<owl:ObjectProperty rdf:about="&knowrob;speaksLanguage">
108-
<rdfs:range rdf:resource="&knowrob;English"/>
109-
<rdfs:range rdf:resource="&knowrob;Greek"/>
108+
<rdfs:range rdf:resource="&knowrob;en"/>
109+
<rdfs:range rdf:resource="&knowrob;el"/>
110110
<rdfs:domain rdf:resource="&knowrob;Agent-Generic"/>
111111
</owl:ObjectProperty>
112112

@@ -8074,11 +8074,11 @@ For predicates that relate things to measurable quantities that characterize the
80748074
<rdfs:subClassOf rdf:resource="&knowrob;SocialConcepts"/>
80758075
</owl:Class>
80768076

8077-
<owl:Class rdf:about="&knowrob;English">
8077+
<owl:Class rdf:about="&knowrob;en">
80788078
<rdfs:subClassOf rdf:resource="&knowrob;HumanLanguage"/>
80798079
</owl:Class>
80808080

8081-
<owl:Class rdf:about="&knowrob;Greek">
8081+
<owl:Class rdf:about="&knowrob;el">
80828082
<rdfs:subClassOf rdf:resource="&knowrob;HumanLanguage"/>
80838083
</owl:Class>
80848084

knowrob_common/prolog/knowrob_owl.pl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
direct_subclassesOf_withCheck/2,
4141
direct_superclassesOf_withCheck/2,
4242
valueToAttribute_withCheck/3,
43-
userCognitiveTestPerformance/8,
43+
userCognitiveTestPerformance/7,
4444
cognitiveTestsOfType/6,
45-
createCognitiveTest/6,
45+
createCognitiveTest/5,
4646
cognitiveTestPerformed/7
4747
]).
4848

@@ -68,9 +68,9 @@
6868
direct_subclassesOf_withCheck(r,r),
6969
direct_superclassesOf_withCheck(r,r),
7070
valueToAttribute_withCheck(r,r,r),
71-
userCognitiveTestPerformance(r,r,r,r,r,r,r,r),
71+
userCognitiveTestPerformance(r,r,r,r,r,r,r),
7272
cognitiveTestsOfType(r,r,r,r,r,r),
73-
createCognitiveTest(r,r,r,r,r,r),
73+
createCognitiveTest(r,r,r,r,r),
7474
cognitiveTestPerformed(r,r,r,r,r,r,r),
7575
create_timepoint(+,r),
7676
get_timepoint(r),
@@ -378,26 +378,24 @@
378378
rdf_has(A,rdfs:range,Cclass),
379379
rdf_assert(B,A,C).
380380

381-
userCognitiveTestPerformance(A,C,B,Var,Dif,Timestamp,SC,P):-
381+
userCognitiveTestPerformance(A,C,B,Dif,Timestamp,SC,P):-
382382
rdf_has(P,knowrob:cognitiveTestPerformedPatient,A),
383383
rdf_has(P,knowrob:cognitiveTestPerformedTestType,B),
384384
rdf_has(B,rdf:type,C),
385-
rdf_has(B,knowrob:cognitiveTestVariation,literal(type(_, Var))),
386385
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
387386
rdf_has(P,knowrob:cognitiveTestPerformedTimestamp,literal(type(_, Timestamp))),
388387
rdf_has(P,knowrob:cognitiveTestPerformedScore,literal(type(_, SC))).
389388

390-
cognitiveTestsOfType(A,B,Var,Path,Dif,Sub):-
389+
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language):-
391390
rdf_has(B,rdf:type,A),
392-
rdf_has(B,knowrob:cognitiveTestVariation,literal(type(_, Var))),
391+
rdf_has(B,knowrob:supportedLanguages,Language),
393392
rdf_has(B,knowrob:cognitiveTestFilePath,literal(type(_, Path))),
394393
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
395394
rdf_has(B,knowrob:cognitiveTestSubType,Sub).
396395

397-
createCognitiveTest(A,B,C,D,E,F):-
396+
createCognitiveTest(A,B,D,E,F):-
398397
owl_subclass_of(F,A),
399398
rdf_instance_from_class(A,B),
400-
rdf_assert(B,knowrob:cognitiveTestVariation,literal(type(xsd:string,C))),
401399
rdf_assert(B,knowrob:cognitiveTestDifficulty,literal(type(xsd:string,D))),
402400
rdf_assert(B,knowrob:cognitiveTestFilePath,literal(type(xsd:string,E))),
403401
rdf_assert(B,knowrob:cognitiveTestSubType,F).

knowrob_common/prolog/knowrob_owl.pl~

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
valueToAttribute_withCheck/3,
4343
userCognitiveTestPerformance/8,
4444
cognitiveTestsOfType/6,
45-
createCognitiveTest/6,
45+
createCognitiveTest/5,
4646
cognitiveTestPerformed/7
4747
]).
4848

@@ -70,7 +70,7 @@
7070
valueToAttribute_withCheck(r,r,r),
7171
userCognitiveTestPerformance(r,r,r,r,r,r,r,r),
7272
cognitiveTestsOfType(r,r,r,r,r,r),
73-
createCognitiveTest(r,r,r,r,r,r),
73+
createCognitiveTest(r,r,r,r,r),
7474
cognitiveTestPerformed(r,r,r,r,r,r,r),
7575
create_timepoint(+,r),
7676
get_timepoint(r),
@@ -382,30 +382,28 @@ userCognitiveTestPerformance(A,C,B,Var,Dif,Timestamp,SC,P):-
382382
rdf_has(P,knowrob:cognitiveTestPerformedPatient,A),
383383
rdf_has(P,knowrob:cognitiveTestPerformedTestType,B),
384384
rdf_has(B,rdf:type,C),
385-
rdf_has(B,knowrob:cognitiveTestVariation,literal(type(_, Var))),
386385
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
387386
rdf_has(P,knowrob:cognitiveTestPerformedTimestamp,literal(type(_, Timestamp))),
388387
rdf_has(P,knowrob:cognitiveTestPerformedScore,literal(type(_, SC))).
389388

390-
cognitiveTestsOfType(A,B,Var,Path,Dif,Sub):-
389+
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language):-
391390
rdf_has(B,rdf:type,A),
392-
rdf_has(B,knowrob:cognitiveTestVariation,literal(type(_, Var))),
391+
rdf_has(B,knowrob:supportedLanguages,Language),
393392
rdf_has(B,knowrob:cognitiveTestFilePath,literal(type(_, Path))),
394393
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
395394
rdf_has(B,knowrob:cognitiveTestSubType,Sub).
396395

397-
createCognitiveTest(A,B,C,D,E,F):-
396+
createCognitiveTest(A,B,D,E,F):-
398397
owl_subclass_of(F,A),
399398
rdf_instance_from_class(A,B),
400-
rdf_assert(B,knowrob:cognitiveTestVariation,literal(type(xsd:string,C))),
401399
rdf_assert(B,knowrob:cognitiveTestDifficulty,literal(type(xsd:string,D))),
402400
rdf_assert(B,knowrob:cognitiveTestFilePath,literal(type(xsd:string,E))),
403401
rdf_assert(B,knowrob:cognitiveTestSubType,F).
404402

405403
cognitiveTestPerformed(B,Patient,Test,Time,Score,C,D):-
406404
rdf_has(Patient,rdf:type,C),
407405
rdf_instance_from_class(D,B),
408-
rdf_has(Test,knowrob:cognitiveTestSubType,something),
406+
rdf_has(Test,knowrob:cognitiveTestSubType,L),
409407
rdf_assert(B,knowrob:cognitiveTestPerformedPatient,Patient),
410408
rdf_assert(B,knowrob:cognitiveTestPerformedTestType,Test),
411409
rdf_assert(B,knowrob:cognitiveTestPerformedTimestamp,literal(type(xsd:string,Time))),

0 commit comments

Comments
 (0)