Skip to content

Commit

Permalink
Removed unnecessary stuff.
Browse files Browse the repository at this point in the history
I.e. the example classes for LoggingCombiner.
Also removed sensor:userID, we're now using mate:userID instead.
  • Loading branch information
Ferada committed Oct 18, 2011
1 parent c0e5c63 commit 4c374bc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 112 deletions.
92 changes: 46 additions & 46 deletions mate.n3
Expand Up @@ -6,23 +6,45 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix mate: <http://www.imis.uni-luebeck.de/mate#> .

:AvailabilityResult
a owl:Class ;
:ignoreIndex "true"^^xsd:boolean ;
rdfs:label "Verfügbarkeitsresultat"@de , "Availability Result"@en ;
:primaryKey :AvailabilityKey .

:Person
a owl:Class ;
:ignoreIndex "true"^^xsd:boolean ;
rdfs:label "Person" ;
owl:equivalentClass foaf:Person .

:AvailabilityResultMod
a owl:Class ;
:ignoreIndex "true"^^xsd:boolean ;
rdfs:label "Availability Result (modified)"@en , "Verfügbarkeitsresultat (modifiziert)"@de ;
:primaryKey :AvailabilityModKey .
# unused

# :Person
# a owl:Class ;
# :ignoreIndex "true"^^xsd:boolean ;
# rdfs:label "Person" ;
# owl:equivalentClass foaf:Person .

# examples for LoggingCombiner

# :AvailabilityResult
# a owl:Class ;
# :ignoreIndex "true"^^xsd:boolean ;
# rdfs:label "Verfügbarkeitsresultat"@de , "Availability Result"@en ;
# :primaryKey :AvailabilityKey .

# :AvailabilityResultMod
# a owl:Class ;
# :ignoreIndex "true"^^xsd:boolean ;
# rdfs:label "Availability Result (modified)"@en , "Verfügbarkeitsresultat (modifiziert)"@de ;
# :primaryKey (:jid) .

# :available
# a owl:DatatypeProperty ;
# rdfs:domain
# [ a owl:Class ;
# owl:unionOf (:AvailabilityResult :HistoryEntry :AvailabilityResultMod)
# ] ;
# rdfs:label "available"@en , "verfügbar"@de ;
# rdfs:range xsd:boolean .

# :jid
# a owl:DatatypeProperty ;
# rdfs:domain
# [ a owl:Class ;
# owl:unionOf (:AvailabilityResult :HistoryEntry :AvailabilityResultMod)
# ] ;
# rdfs:label "Jabber ID" ;
# rdfs:range xsd:string .

<http://www.imis.uni-luebeck.de/mate>
a owl:Ontology ;
Expand All @@ -45,36 +67,19 @@
:ignoreIndex
a owl:AnnotationProperty ;
rdfs:domain owl:Class ;
rdfs:range xsd:boolean .

:AvailabilityKey
a :PropertyList ;
rdf:first :jid ;
rdf:rest () .

:jid
a owl:DatatypeProperty ;
rdfs:domain
[ a owl:Class ;
owl:unionOf (:AvailabilityResult :HistoryEntry :AvailabilityResultMod)
] ;
rdfs:label "Jabber ID" ;
rdfs:range xsd:string .
rdfs:range xsd:boolean ;
rdfs:comment """Die markierte Klasse wird während des Einlesens
ignoriert, d.h. es wird nicht nach einem Primärschlüssel gesucht
und anschließend eine Warnung ausgegeben."""@de ,
"""The marked class will be ignored during initialization,
i.e. there will be no warning when a class couldn't be used because
there was no primary key defined."""@en .

:HistoryEntry
a owl:Class ;
:ignoreIndex "true"^^xsd:boolean ;
rdfs:label "History Entry"@en , "History-Eintrag"@de .

:available
a owl:DatatypeProperty ;
rdfs:domain
[ a owl:Class ;
owl:unionOf (:AvailabilityResult :HistoryEntry :AvailabilityResultMod)
] ;
rdfs:label "available"@en , "verfügbar"@de ;
rdfs:range xsd:boolean .

:PropertyList
a owl:Class ;
:ignoreIndex "true"^^xsd:boolean ;
Expand Down Expand Up @@ -116,11 +121,6 @@
rdfs:range :PropertyList ;
rdfs:label "extract explicit"@en , "extrahiere explizit"@de .

:AvailabilityModKey
a :PropertyList ;
rdf:first :jid ;
rdf:rest () .

# TODO: narf, duplicating sensors stuff, should we use sameAs or some other convention?

:userID
Expand Down
3 changes: 2 additions & 1 deletion src/board/MessageConverter.java
Expand Up @@ -141,7 +141,8 @@ else if (subject.equals ("mike")) {
ResourceFactory.createResource (sensorURI.toString ())));

model.add (model.createStatement (marker,
Sensors.property ("userID"),
Mate.property ("userID"),
//Sensors.property ("userID"),
ResourceFactory.createTypedLiteral (userID, XSDDatatype.XSDstring)));

/* TODO: what about rooms? */
Expand Down
4 changes: 2 additions & 2 deletions src/board/TestSensorReasoner.java
Expand Up @@ -136,7 +136,7 @@ private void handleCube (Board board, Model model, MateClass klass, Resource mar
String activity = state.getLocalName ();
logger.info ("got a new cube state = " + activity);

Literal userId = marker.getProperty (Sensors.property ("userID")).getLiteral ();
Literal userId = marker.getProperty (Mate.property ("userID")).getLiteral ();
String username = userId.getString ();

// interruptibility
Expand All @@ -156,7 +156,7 @@ private void handleDesktop (Board board, Model model, MateClass klass, Resource
String frequency = frequencyResource.getLocalName ();
logger.info ("got a new desktop state = " + program + ", " + frequency);

Literal userId = marker.getProperty (Sensors.property ("userID")).getLiteral ();
Literal userId = marker.getProperty (Mate.property ("userID")).getLiteral ();
String username = userId.getString ();

// activity
Expand Down
63 changes: 0 additions & 63 deletions src/board/Whiteboard.java
Expand Up @@ -293,69 +293,6 @@ public void run () {

}

public static void main (String args[]) throws Exception {
Options options = Options.getInstance ();
boolean exit = false;
try {
options.parse (args);
}
catch (Exception e) {
logger.error (writeToString (e));
}

if (exit || options.help) {
System.out.println ("Usage: board.Whiteboard [OPTION]...");
options.printHelpOn (System.out);
return;
}
if (options.version) {
System.out.println ("MATe Whiteboard (c) 2011");
return;
}

Whiteboard board = new Whiteboard (options);

Thread thread = new Thread (board, "whiteboard event thread");
thread.start ();

Model sample1 = loadRdf ("sample1.n3", "N3");
Model sample2 = loadRdf ("sample2.n3", "N3");
Model sample3 = loadRdf ("sample3.n3", "N3");
Model sample4 = loadRdf ("sample4.n3", "N3");

LoggingClient client = new LoggingClient ();
LoggingReasoner reasoner = new LoggingReasoner ();

board.registerClient (client);
board.registerClient (reasoner);

board.postSensorUpdate (sample1);
board.postSensorUpdate (sample2);

LoggingCombiner combiner = new LoggingCombiner ();
board.registerCombiner (Mate.resource ("AvailabilityResult").getURI (), combiner);

board.postWorldUpdate (client, sample3);
board.postWorldUpdate (reasoner, sample4);

Query query = QueryFactory.read ("file:query1.sparql");
QueryExecution exec = board.query (query);
logger.info ("running query " + query);
try {
ResultSet results = exec.execSelect ();
while (results.hasNext ()) {
QuerySolution solution = results.next ();

logger.trace ("solution " + solution);
}
}
finally {
exec.close ();
}

thread.join ();
}

/**
* Runs a web server for displaying information and allowing SPARQL/UL
* access to stored information.
Expand Down

0 comments on commit 4c374bc

Please sign in to comment.