/** * @param node * The <code>RDFNode</code> to test presence in <code>model</code>. It should have been created into <code>tempMode</code>. * @return Whether or not <code>node</code> is defined in <code>model</code> . */ protected boolean containsResource(final RDFNode node) { return this.model.containsResource(node); }
/** * {@inheritDoc} */ @Override public boolean containsResource(RDFNode r) { return super.object.containsResource(r); }
public boolean containsResource(RDFNode r) { return model.containsResource(r); }
public void addTermBindings( Model toScan, Model meta, Resource exec, CompleteContext cc ) { Map<String, String> termBindings = cc.include(toScan).Do(); List<String> uriList = new ArrayList<String>( termBindings.keySet() ); Collections.sort( uriList ); for (String uri: uriList) { Resource term = meta.createResource( uri ); if (toScan.containsResource( term )) { String shorty = termBindings.get( uri ); Resource tb = createBNode( meta ); exec.addProperty( API.termBinding, tb ); tb.addProperty( API.label, shorty ); tb.addProperty( API.property, term ); } } }
@Override public boolean hasResource(Resource resource) { if (resource == null) { return false; } Model graph = null; GraphConnection graphConnection = null; try { graphConnection = openGraph(); graph = graphConnection.getGraph(); graph.enterCriticalSection(Lock.READ); com.hp.hpl.jena.graph.Node jenaNodeInst = getJenaNode(resource); RDFNode jenaNode = graph.asRDFNode(jenaNodeInst); return graph.containsResource(jenaNode); } finally { if (graph != null) { graph.leaveCriticalSection(); } if (graphConnection != null) { graphConnection.close(); } } }