r9 - 11 Mar 2005 - 17:05:18 - JohnNiekraszYou are here:  Calo Web > MokbOntologies?  > MokbOntologyUsageExamples

MOKB and MMD Ontology Usage Examples

This document contains a set of MOKB query and update examples for use with the CALO ontology. Please be sure to refer to MokbGrammar for a general explanation of MOKB message syntax and functionality. Also note that it is difficult to keep this completely up to date with the regular ontology changes that are happening. Please be aware of this.

A Typical MOKB Session

  • Start up the agent manager
  • Start the following agents (note that they should be loaded in sequence, wait for each to finish before doing the next or you may run into a Jena-related bug):
    • Administrator
    • Update Server
    • Non-reasoning Query Server
    • Client GUI
  • If this is your first time using a new version of MOKB, or you want to start from a clean database, click INIT on the administrator
  • Test your updates and queries in the Client GUI
  • Run your algorithm
  • Save to file and look at the file to make sure your triples are there

Notes on MOKB client use

  • Be sure to leave some lag time between your last update and saving the db, sometimes OAA is still queueing updates and you last few will not have been inserted in the db before you print it

Current Example Sets

Get all the sentence transcriptions for a particular person in a meeting.

GIVEN:
target person = <tdo:person1>
target meeting = <tdo:meeting1>


mokb_query('
SELECT ?x
WHERE
(?speak <tdo:agent> <tdo:person1>)
(?speak <tdo:object> ?spokensent)
(?spokensent <rdf:type> <tdo:SpokenSentence>)
(?spokensent <tdo:has-transcription> ?x)
(?speak <tdo:time-during> ?ival)
(?ival <tdo:time-begins> ?begin)
(?ival <tdo:time-ends> ?end)
(<tdo:meeting1> <tdo:time-during> ?meetival)
(?meetival <tdo:time-begins> ?meetbegin)
(?meetival <tdo:time-ends> ?meetend)
AND ?begin > ?meetbegin
AND ?end < ?meetend
USING tdo FOR <http://calo.sri.com/core-plus-office#>
')

Query to list all recorded meetings, their name, location, start and stop dates.


mokb_query('SELECT ?meetingID ?meetingName ?place ?start ?end WHERE
( ?meetingID <rdf:type> <tdo:Meeting> )
( ?meetingID <tdo:has-name> ?meetingName )
( ?meetingID <tdo:meeting-room> ?place )
( ?meetingID <tdo:time-during> ?timeint )
( ?timeint <tdo:time-begins> ?start )
( ?timeint <tdo:time-ends> ?end )
USING tdo FOR <http://calo.sri.com/core-plus-office#>')

Query to list all computers that were in meeting [110807671600].


mokb_query('SELECT ?computer WHERE
( <tdo:1108076716000> <rdf:type> <tdo:Meeting> )
( <tdo:1108076716000> <tdo:time-during> ?timeint1 )
( ?timeint1 <tdo:time-begins> ?common-start )
( ?timeint1 <tdo:time-ends> ?common-end )
( <tdo:1108076716000> <tdo:meeting-room> ?place )
( ?Be-Contained <rdf:type> <tdo:Be-Contained> )
( ?Be-Contained <tdo:agent> ?computer )
( ?Be-Contained <tdo:base> ?place )
( ?Be-Contained <tdo:time-during> ?timeint2 )
( ?timeint2 <tdo:time-begins> ?common-start )
( ?timeint2 <tdo:time-ends> ?common-end )
USING tdo FOR <http://calo.sri.com/core-plus-office#>')

Query to list all users who registered during meeting [110807671700] and the start and stop times of their registration (note these times can be start before the meeting starts and end before the meeting ends).


mokb_query('SELECT ?user ?start ?end WHERE
( <tdo:1108076716000> <rdf:type> <tdo:Meeting> )
( ?registerForMeeting <rdf:type> <tdo:RegisterForMeeting> )
( ?registerForMeeting <tdo:object> <tdo:1108076716000> )
( ?registerForMeeting <tdo:agent> ?user )
( ?registerForMeeting <tdo:time-during> ?timeint )
( ?timeint <tdo:time-begins> ?start )
( ?timeint <tdo:time-ends> ?end )
USING tdo FOR <http://calo.sri.com/core-plus-office#>')

Query to return the user files (frame stereo camera directory, frame array microphone file, Meeting Recorder Client audio file) from meeting [110807671600] associated with user [voss]:.


mokb_query('SELECT ?uri WHERE
( <tdo:1108076716000> <rdf:type> <tdo:Meeting> )
( ?registerForMeeting <rdf:type> <tdo:RegisterForMeeting> )
( ?registerForMeeting <tdo:object> <tdo:1108076716000> )
( ?registerForMeeting <tdo:agent> <tdo:voss> )
( ?registerForMeeting <tdo:instrument> ?computer )
( ?computer <rdf:type> <tdo:Computer> )
( ?computer <tdo:has-part> ?frameDevice )
( ?frameDevice <rdf:type> <tdo:FrameDevice> )
( ?frameDevice <tdo:has-part> ?sensor )
( ?registerForMeeting <tdo:time-during> ?timeint1 )
( ?timeint1 <tdo:time-begins> ?common-start )
( ?timeint1 <tdo:time-ends> ?common-end )
( ?record <tdo:time-during> ?timeint2 )
( ?timeint2 <tdo:time-begins> ?common-start )
( ?timeint2 <tdo:time-ends> ?common-end )
( ?record <rdf:type> <tdo:Record> )
( ?record <tdo:agent> ?sensor )
( ?recording <rdf:type> <tdo:Recording> )
( ?record <tdo:result> ?recording )
( ?recording <tdo:has-uri> ?uri )
USING tdo FOR <http://calo.sri.com/core-plus-office#>')

Query to get just the Meeting Recorder Client directory (where it stores the text, ppt, and close-talking microphone files) for meeting [110807671600] for user [voss]:.


mokb_query('SELECT ?uri WHERE
( <tdo:1108076716000> <rdf:type> <tdo:Meeting> )
( ?registerForMeeting <rdf:type> <tdo:RegisterForMeeting> )
( ?registerForMeeting <tdo:object> <tdo:1108076716000> )
( ?registerForMeeting <tdo:agent> <tdo:voss> )
( ?computer <rdf:type> <tdo:Computer> )
( ?registerForMeeting <tdo:instrument> ?computer )
( ?meetingRecorderClient <rdf:type> <tdo:SoftwareAgent> )
( ?meetingRecorderClient <tdo:has-name>
"MeetingRecorderClient"^^<xsd:string> )
( ?computer <tdo:has-part> ?meetingRecorderClient )
( ?registerForMeeting <tdo:time-during> ?timeint1 )
( ?timeint1 <tdo:time-begins> ?common-start )
( ?timeint1 <tdo:time-ends> ?common-end )
( ?record <rdf:type> <tdo:Record> )
( ?record <tdo:time-during> ?timeint2 )
( ?timeint2 <tdo:time-begins> ?common-start )
( ?timeint2 <tdo:time-ends> ?common-end )
( ?record <tdo:agent> ?meetingRecorderClient )
( ?recording <rdf:type> <tdo:Recording> )
( ?record <tdo:result> ?recording )
( ?recording <tdo:has-uri> ?uri )
USING tdo FOR <http://calo.sri.com/core-plus-office#>')

Query to get just the audio file from the Meeting Recorder Client from meeting [110807671600] for user [voss]:.


mokb_query('SELECT ?uri WHERE
( <tdo:1108076716000> <rdf:type> <tdo:Meeting> )
( ?registerForMeeting <rdf:type> <tdo:RegisterForMeeting> )
( ?registerForMeeting <tdo:object> <tdo:1108076716000> )
( ?registerForMeeting <tdo:agent> <tdo:voss> )
( ?registerForMeeting <tdo:instrument> ?computer )
( ?computer <rdf:type> <tdo:Computer> )
( ?computer <tdo:has-part> ?frameDevice )
( ?frameDevice <rdf:type> <tdo:FrameDevice> )
( ?frameDevice <tdo:has-part> ?sensor )
( ?sensor <tdo:has-name> "CloseTalkingMicrophone"^^<xsd:string> )
( ?registerForMeeting <tdo:time-during> ?timeint1 )
( ?timeint1 <tdo:time-begins> ?common-start )
( ?timeint1 <tdo:time-ends> ?common-end )
( ?record <tdo:time-during> ?timeint2 )
( ?timeint2 <tdo:time-begins> ?common-start )
( ?timeint2 <tdo:time-ends> ?common-end )
( ?record <rdf:type> <tdo:Record> )
( ?record <tdo:agent> ?sensor )
( ?recording <rdf:type> <tdo:Recording> )
( ?record <tdo:result> ?recording )
( ?recording <tdo:has-uri> ?uri )
USING tdo FOR <http://calo.sri.com/core-plus-office#>')

Query to list all the files recorded from server processes (not personal frame files for meeting [1108076716000]:.


mokb_query('SELECT ?uri WHERE
( <tdo:1108076716000> <rdf:type> <tdo:Meeting> )
( <tdo:1108076716000> <tdo:meeting-room> ?place )
( ?Be-Contained <rdf:type> <tdo:Be-Contained> )
( ?Be-Contained <tdo:agent> ?computer )
( ?Be-Contained <tdo:base> ?place )
( ?computer <rdf:type> <tdo:Computer> )
( ?computer <tdo:has-part> ?sensor )
( ?record <tdo:agent> ?sensor )
( ?record <rdf:type> <tdo:Record> )
( ?record <tdo:result> ?recording )
( ?recording <rdf:type> <tdo:Recording> )
( ?recording <tdo:has-uri> ?uri )
( <tdo:1108076716000> <tdo:time-during> ?timeint1 )
( ?timeint1 <tdo:time-begins> ?common-start )
( ?timeint1 <tdo:time-ends> ?common-end )
( ?Be-Contained <tdo:time-during> ?timeint2 )
( ?timeint2 <tdo:time-begins> ?common-start )
( ?timeint2 <tdo:time-ends> ?common-end )
( ?record <tdo:time-during> ?timeint3 )
( ?timeint3 <tdo:time-begins> ?common-start )
( ?timeint3 <tdo:time-ends> ?common-end )
USING tdo FOR <http://calo.sri.com/core-plus-office#>')

Return all the occurrences of any person being in front of any whiteboard:.



mokb_query('
SELECT ?person, ?starttime, ?endtime
WHERE
(?person <rdf:type> <tdo:Person>)
(?infront <rdf:type> <tdo:Being-In-Front-Of>)
(?whiteboard <rdf:type> <tdo:Whiteboard>)
(?infront <tdo:object> ?person)
(?infront <tdo:base> ?whiteboard)
(?infront <tdo:time-during> ?timeinterval)
(?time-interval <tdo:time-begins> ?starttime)
(?time-interval <tdo:time-ends> ?endtime)
USING tdo FOR <http://calo.sri.com/core-plus-office#>
')

ISSUE.




ISSUE.




ISSUE.




ISSUE.




ISSUE.




ISSUE.




ISSUE.




ISSUE.




ISSUE.




 

Semlab Home      
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Semlab? Send feedback