Finish generator for TBox

This commit is contained in:
Jan Philipp Timme 2017-11-20 22:38:09 +01:00
parent 6408bec808
commit 950ead445d
2 changed files with 14 additions and 7 deletions

View File

@ -5,13 +5,6 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rev: <http://purl.org/stuff/rev#> . @prefix rev: <http://purl.org/stuff/rev#> .
# Our classes
:GameConsole rdf:type rdf:Class .
:PortableGameConsole rdf:type rdf:Class ;
rdfs:subclassOf :GameConsole .
# Our own properties # Our own properties
:ceo rdf:type rdf:Property ; :ceo rdf:type rdf:Property ;
rdfs:domain foaf:Organization ; rdfs:domain foaf:Organization ;

View File

@ -29,15 +29,20 @@ public class Generator {
Resource rdfProperty = model.createResource(rdfUri+"Property"); Resource rdfProperty = model.createResource(rdfUri+"Property");
Property rdfsSubclassOf = model.createProperty(rdfsUri+"subclassOf"); Property rdfsSubclassOf = model.createProperty(rdfsUri+"subclassOf");
Property rdfsSubPropertyOf = model.createProperty(rdfsUri+"subPropertyOf");
Property rdfsDomain = model.createProperty(rdfsUri+"domain"); Property rdfsDomain = model.createProperty(rdfsUri+"domain");
Property rdfsRange = model.createProperty(rdfsUri+"range"); Property rdfsRange = model.createProperty(rdfsUri+"range");
Property rdfsLabel = model.createProperty(rdfsUri+"label");
Property rdfsDatatype = model.createProperty(rdfsUri+"Datatype");
Resource foafPerson = model.createResource(foafUri+"Person"); Resource foafPerson = model.createResource(foafUri+"Person");
Resource foafOrganization = model.createResource(foafUri+"Organization"); Resource foafOrganization = model.createResource(foafUri+"Organization");
Resource xsdInt = model.createResource(xsdUri+"int"); Resource xsdInt = model.createResource(xsdUri+"int");
Resource xsdBoolean = model.createResource(xsdUri+"boolean"); Resource xsdBoolean = model.createResource(xsdUri+"boolean");
Resource xsdString = model.createResource(xsdUri+"string"); Resource xsdString = model.createResource(xsdUri+"string");
// Own classes // Own classes
Resource gameConsole = model.createResource(ownUri+"GameConsole"); Resource gameConsole = model.createResource(ownUri+"GameConsole");
@ -99,6 +104,15 @@ public class Generator {
madeBy.addProperty(rdfsDomain, gameConsole); madeBy.addProperty(rdfsDomain, gameConsole);
madeBy.addProperty(rdfsRange, foafOrganization); madeBy.addProperty(rdfsRange, foafOrganization);
// Declare our datatype
Resource priceEur = model.createResource(ownUri+"PriceEur");
priceEur.addProperty(rdfType, rdfsDatatype);
priceEur.addProperty(rdfsLabel, "Preis in Euro");
// Use of subPropertyOf
predecessorOfConsole.addProperty(rdfsSubPropertyOf, relatedToConsole);
successorOfConsole.addProperty(rdfsSubPropertyOf, relatedToConsole);
// Store the model into a file // Store the model into a file
Generator.writeModelToFile(model, "./output/tbox.ttl"); Generator.writeModelToFile(model, "./output/tbox.ttl");
} }