Skip to content

Commit 00dcf49

Browse files
committed
cognitive system updated with functionality of retrieving test by type, subtype, difficulty and id query
1 parent 4657d1c commit 00dcf49

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

knowrob_common/prolog/knowrob_owl.pl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
direct_superclassesOf_withCheck/2,
4242
valueToAttribute_withCheck/3,
4343
userCognitiveTestPerformance/8,
44-
cognitiveTestsOfType/6,
45-
createCognitiveTest/5,
44+
cognitiveTestsOfType/7,
45+
createCognitiveTest/6,
4646
cognitiveTestPerformed/7,
4747
createObjectAndRegisterImage/6
4848
]).
@@ -70,8 +70,8 @@
7070
direct_superclassesOf_withCheck(r,r),
7171
valueToAttribute_withCheck(r,r,r),
7272
userCognitiveTestPerformance(r,r,r,r,r,r,r,r),
73-
cognitiveTestsOfType(r,r,r,r,r,r),
74-
createCognitiveTest(r,r,r,r,r),
73+
cognitiveTestsOfType(r,r,r,r,r,r,r),
74+
createCognitiveTest(r,r,r,r,r,r),
7575
cognitiveTestPerformed(r,r,r,r,r,r,r),
7676
createObjectAndRegisterImage(r,r,r,r,r,r),
7777
create_timepoint(+,r),
@@ -389,22 +389,23 @@
389389
rdf_has(P,knowrob:cognitiveTestPerformedTimestamp,literal(type(_, Timestamp))),
390390
rdf_has(P,knowrob:cognitiveTestPerformedScore,literal(type(_, SC))).
391391

392-
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language):-
392+
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language,Id):-
393393
rdf_has(B,rdf:type,A),
394394
rdf_has(B,knowrob:supportedLanguages,Language),
395395
rdf_has(B,knowrob:cognitiveTestFilePath,literal(type(_, Path))),
396396
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
397-
rdf_has(B,knowrob:cognitiveTestSubType,Sub).
397+
rdf_has(B,knowrob:cognitiveTestSubType,Sub),
398+
rdf_has(B,knowrob:cognitiveTestId,literal(type(_, Id))).
398399

399-
createCognitiveTest(A,B,D,E,F):-
400+
createCognitiveTest(A,B,D,E,F,G):-
400401
owl_subclass_of(F,A),
401402
rdf_instance_from_class(A,B),
402403
rdf_assert(B,knowrob:cognitiveTestDifficulty,literal(type(xsd:string,D))),
403404
rdf_assert(B,knowrob:cognitiveTestFilePath,literal(type(xsd:string,E))),
404-
rdf_assert(B,knowrob:cognitiveTestSubType,F).
405+
rdf_assert(B,knowrob:cognitiveTestSubType,F),
406+
rdf_assert(B,knowrob:cognitiveTestId,literal(type(xsd:string,G))).
405407

406408
cognitiveTestPerformed(B,Patient,Test,Time,Score,C,D):-
407-
rdf_has(Patient,rdf:type,C),
408409
rdf_instance_from_class(D,B),
409410
rdf_has(Test,knowrob:cognitiveTestSubType,L),
410411
rdf_assert(B,knowrob:cognitiveTestPerformedPatient,Patient),

knowrob_common/prolog/knowrob_owl.pl~

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

5050
:- use_module(library('crypt')).
@@ -70,10 +70,10 @@
7070
direct_superclassesOf_withCheck(r,r),
7171
valueToAttribute_withCheck(r,r,r),
7272
userCognitiveTestPerformance(r,r,r,r,r,r,r,r),
73-
cognitiveTestsOfType(r,r,r,r,r,r),
74-
createCognitiveTest(r,r,r,r,r),
73+
cognitiveTestsOfType(r,r,r,r,r,r,r),
74+
createCognitiveTest(r,r,r,r,r,r),
7575
cognitiveTestPerformed(r,r,r,r,r,r,r),
76-
createObjectAndRegisterImage(r,r,r,r,r),
76+
createObjectAndRegisterImage(r,r,r,r,r,r),
7777
create_timepoint(+,r),
7878
get_timepoint(r),
7979
get_timepoint(+,r),
@@ -389,19 +389,21 @@ rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
389389
rdf_has(P,knowrob:cognitiveTestPerformedTimestamp,literal(type(_, Timestamp))),
390390
rdf_has(P,knowrob:cognitiveTestPerformedScore,literal(type(_, SC))).
391391

392-
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language):-
392+
cognitiveTestsOfType(A,B,Path,Dif,Sub,Language,Id):-
393393
rdf_has(B,rdf:type,A),
394394
rdf_has(B,knowrob:supportedLanguages,Language),
395395
rdf_has(B,knowrob:cognitiveTestFilePath,literal(type(_, Path))),
396396
rdf_has(B,knowrob:cognitiveTestDifficulty,literal(type(_, Dif))),
397-
rdf_has(B,knowrob:cognitiveTestSubType,Sub).
397+
rdf_has(B,knowrob:cognitiveTestSubType,Sub),
398+
rdf_has(B,knowrob:cognitiveTestId,literal(type(_, Id))).
398399

399-
createCognitiveTest(A,B,D,E,F):-
400+
createCognitiveTest(A,B,D,E,F,G):-
400401
owl_subclass_of(F,A),
401402
rdf_instance_from_class(A,B),
402403
rdf_assert(B,knowrob:cognitiveTestDifficulty,literal(type(xsd:string,D))),
403404
rdf_assert(B,knowrob:cognitiveTestFilePath,literal(type(xsd:string,E))),
404-
rdf_assert(B,knowrob:cognitiveTestSubType,F).
405+
rdf_assert(B,knowrob:cognitiveTestSubType,F),
406+
rdf_assert(B,knowrob:cognitiveTestId,literal(type(xsd:string,G))).
405407

406408
cognitiveTestPerformed(B,Patient,Test,Time,Score,C,D):-
407409
rdf_has(Patient,rdf:type,C),

0 commit comments

Comments
 (0)