From: <lor...@us...> - 2014-02-03 14:41:57
|
Revision: 4219 http://sourceforge.net/p/dl-learner/code/4219 Author: lorenz_b Date: 2014-02-03 14:41:54 +0000 (Mon, 03 Feb 2014) Log Message: ----------- Added method to get transitive closure of sublcasses via SPARQL 1.1 Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java 2014-02-03 14:37:33 UTC (rev 4218) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java 2014-02-03 14:41:54 UTC (rev 4219) @@ -1587,15 +1587,16 @@ } public SortedSet<Description> getSubClasses(Description description, boolean direct) { - SortedSet<Description> subClasses = new TreeSet<Description>(); + SortedSet<Description> subClasses = new TreeSet<Description>(conceptComparator); String query; if(direct){ query = String.format("SELECT ?sub {?sub <%s> <%s>. FILTER(isIRI(?sub))}", - RDFS.subClassOf.getURI(), - ((NamedClass)description).getURI().toString()); + RDFS.subClassOf.getURI(), ((description instanceof Thing) ? Thing.uri.toString() : ((NamedClass)description).getURI().toString()) + ); } else { query = String.format("SELECT ?sub {?sub <http://www.w3.org/2000/01/rdf-schema#subClassOf>* <%s>. }", - ((NamedClass)description).getURI().toString()); + ((description instanceof Thing) ? Thing.uri.toString() : ((NamedClass)description).getURI().toString()) + ); } ResultSet rs = executeSelectQuery(query); QuerySolution qs; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |