/** Converts all object occurances of rdfs:Resource with owl:Thing */ private void convertRDFSResource() { for (StmtIterator it = model.listStatements(null, null, RDFS.Resource); it.hasNext(); ) { Statement s = it.nextStatement(); s.getModel().add(s.getSubject(), s.getPredicate(), OWL.Thing); if (log.isLoggable(Level.FINE)) { log.fine("Replaced triple " + s + " with (x, x, owl:Thing)"); } it.remove(); } }
/** Converts all rdfs:Classes into owl:Classes */ private void convertRDFSClasses() { for (StmtIterator it = model.listStatements(null, RDF.type, RDFS.Class); it.hasNext(); ) { Statement s = it.nextStatement(); Resource clazz = s.getSubject(); s.getModel().add(clazz, RDF.type, OWL.Class); it.remove(); if (log.isLoggable(Level.FINE)) { log.fine("Converted rdfs:Class " + clazz + " into owl:Class"); } } }
/** Converts the properties to either owl:DatatypeProperties or owl:ObjectProperties. */ private void convertProperties() { for (StmtIterator it = model.listStatements(null, RDF.type, RDF.Property); it.hasNext(); ) { Statement s = it.nextStatement(); Resource property = s.getSubject(); Resource type = getPropertyType(property); s.getModel().add(property, RDF.type, type); it.remove(); if (log.isLoggable(Level.FINE)) { log.fine("Converted rdf:Property " + property + " into " + type); } } }