From: <lor...@us...> - 2013-05-10 10:01:24
|
Revision: 3976 http://sourceforge.net/p/dl-learner/code/3976 Author: lorenz_b Date: 2013-05-10 10:01:19 +0000 (Fri, 10 May 2013) Log Message: ----------- Changed SPARQL converter. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java 2013-05-10 09:55:47 UTC (rev 3975) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLClassExpressionToSPARQLConverter.java 2013-05-10 10:01:19 UTC (rev 3976) @@ -108,7 +108,16 @@ } public Query asQuery(String rootVariable, OWLClassExpression expr, boolean countQuery){ - return asQuery(rootVariable, expr, Collections.<OWLEntity>emptySet()); + String queryString = "SELECT "; + String triplePattern = convert(rootVariable, expr); + if(countQuery){ + queryString += "(COUNT(DISTINCT " + rootVariable + ") AS ?cnt) WHERE {"; + } else { + queryString += "DISTINCT " + rootVariable + " WHERE {"; + } + queryString += triplePattern; + queryString += "}"; + return QueryFactory.create(queryString, Syntax.syntaxARQ); } public Query asQuery(String rootVariable, OWLClassExpression expr, Set<? extends OWLEntity> variableEntities){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |