NIHVIVO-3884 adding constant for blank node root finding query
This commit is contained in:
parent
edcf7f708e
commit
bb4365cfa8
3 changed files with 5 additions and 4 deletions
|
@ -27,6 +27,9 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
|||
public abstract class RDFServiceImpl implements RDFService {
|
||||
|
||||
private static final Log log = LogFactory.getLog(RDFServiceImpl.class);
|
||||
protected static final String BNODE_ROOT_QUERY =
|
||||
"SELECT ?s WHERE { ?s ?p ?o OPTIONAL { ?ss ?pp ?s } FILTER (!isBlank(?s) || !bound(?ss)) }";
|
||||
|
||||
protected String defaultWriteGraphURI;
|
||||
protected List<ChangeListener> registeredListeners = new CopyOnWriteArrayList<ChangeListener>();
|
||||
|
||||
|
|
|
@ -93,8 +93,7 @@ public abstract class RDFServiceJena extends RDFServiceImpl implements RDFServic
|
|||
log.warn("This likely indicates a problem; excessive data may be deleted.");
|
||||
}
|
||||
|
||||
String rootFinder = "SELECT ?s WHERE { ?s ?p ?o OPTIONAL { ?ss ?pp ?s } FILTER (!isBlank(?s) || !bound(?ss)) }";
|
||||
Query rootFinderQuery = QueryFactory.create(rootFinder);
|
||||
Query rootFinderQuery = QueryFactory.create(BNODE_ROOT_QUERY);
|
||||
QueryExecution qe = QueryExecutionFactory.create(rootFinderQuery, blankNodeModel);
|
||||
try {
|
||||
ResultSet rs = qe.execSelect();
|
||||
|
|
|
@ -620,8 +620,7 @@ public class RDFServiceSparql extends RDFServiceImpl implements RDFService {
|
|||
log.warn("This likely indicates a problem; excessive data may be deleted.");
|
||||
}
|
||||
|
||||
String rootFinder = "SELECT ?s WHERE { ?s ?p ?o OPTIONAL { ?ss ?pp ?s FILTER(!isBlank(?ss)) } FILTER (!bound(?ss)) }";
|
||||
Query rootFinderQuery = QueryFactory.create(rootFinder);
|
||||
Query rootFinderQuery = QueryFactory.create(BNODE_ROOT_QUERY);
|
||||
QueryExecution qe = QueryExecutionFactory.create(rootFinderQuery, blankNodeModel);
|
||||
try {
|
||||
ResultSet rs = qe.execSelect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue