public boolean contains(Value subj, URI pred, Value obj) { if (subj == null || subj instanceof Resource) return model.contains((Resource) subj, pred, obj); return false; }
public boolean contains(Value subj, Value pred, Value obj, Value... contexts) { for (Model model : models) { if (model.contains(subj, pred, obj, contexts)) return true; } return false; }
public boolean contains(Value subj, URI pred, Value obj) { if (subj == null || subj instanceof Resource) return model.contains((Resource) subj, pred, obj); return false; }
@Override public boolean contains(Resource subj, IRI pred, Value obj, Resource... contexts) { return model.contains(subj, pred, obj, contexts); }
protected boolean accept(Statement stmt) { return !excluded.contains(stmt); } };
public boolean isA(URI type) { return model.contains(self, RDF.TYPE, type); }
public boolean isA(URI type) { return model.contains(self, RDF.TYPE, type); }
/** * @deprecated since 4.0. Use * {@link #contains(Resource, IRI, Value, Resource...)} instead. */ @Deprecated public default boolean contains(Resource subj, URI pred, Value obj, Resource... contexts) { return contains(subj, (IRI)pred, obj, contexts); }
private boolean isParameter(Resource prop) { return !model.contains(prop, RDF.TYPE, OWL.ANNOTATIONPROPERTY) && prop instanceof URI && !prop.stringValue().startsWith(MSG.NAMESPACE); }
private boolean isParameter(Resource prop) { return !model.contains(prop, RDF.TYPE, OWL.ANNOTATIONPROPERTY) && prop instanceof URI && !prop.stringValue().startsWith(MSG.NAMESPACE); }
public boolean contains(Value subj, Value pred, Value obj, Value... contexts) { return getDelegate().contains(subj, pred, obj, contexts); }
@Override public synchronized void deprecate(Resource subj, IRI pred, Value obj, Resource ctx) { if (approved != null) { approved.remove(subj, pred, obj, ctx); } if (deprecated == null) { deprecated = createEmptyModel(); } deprecated.add(subj, pred, obj, ctx); if (approvedContexts != null && approvedContexts.contains(ctx) && !approved.contains(null, null, null, ctx)) { approvedContexts.remove(ctx); } }
protected void assertExpected(final Model actual, final Statement... expectedStatements) throws Exception { final Model expected = new TreeModel(); Collections.addAll(expected, expectedStatements); for(final Statement t : expected) { if(!actual.contains(t)) { Assert.fail("expected statement not found: " + t); } } for(final Statement t : actual) { if(!expected.contains(t)) { Assert.fail("unexpected statement found: " + t); } } }
public String getPluralParameterName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); String plural = plural(localPart); if (model.contains(new URIImpl(ns + plural), null, null)) { plural = localPart; } return word(plural); }
public String getPluralPropertyName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); String plural = plural(localPart); if (model.contains(new URIImpl(ns + plural), null, null)) { plural = localPart; } if (prefixes.containsKey(ns)) return getMemberPrefix(ns) + initcap(plural); return enc(plural); }
public String getPluralParameterName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); String plural = plural(localPart); if (model.contains(new URIImpl(ns + plural), null, null)) { plural = localPart; } return word(plural); }
public String getPluralPropertyName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); String plural = plural(localPart); if (model.contains(new URIImpl(ns + plural), null, null)) { plural = localPart; } if (prefixes.containsKey(ns)) return getMemberPrefix(ns) + initcap(plural); return enc(plural); }
@Test public void testSES2104ConstructBGPSameURI() throws Exception { final String queryStr = "PREFIX : <urn:> CONSTRUCT {:x :p :x } WHERE {} "; conn.add(new StringReader("@prefix : <urn:> . :a :p :b . "), "", RDFFormat.TURTLE); final IRI x = conn.getValueFactory().createIRI("urn:x"); final IRI p = conn.getValueFactory().createIRI("urn:p"); GraphQuery query = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryStr); Model result = QueryResults.asModel(query.evaluate()); assertNotNull(result); assertFalse(result.isEmpty()); assertTrue(result.contains(x, p, x)); }
@Override public void parse(Model model, Resource implNode) throws StoreConfigException { super.parse(model, implNode); for (Value node : model.filter(implNode, GRAPH, null).objects()) { URI name = model.filter((Resource)node, NAME, null).objectURI(); String url = model.filter((Resource)node, DATASET, null).objectString(); addGraph(name, url); } if (model.contains(implNode, CLOSED, null)) { closed = model.filter(implNode, CLOSED, null).objectLiteral().booleanValue(); } } }
/** * Test whether Annotations can be listed using an HTTP GET request to retrieve RDF/XML. */ @Test public void testAnnotationListMultipleRdfXml() throws Exception { this.createTestAnnotations(50); final ClientResource getResource = new ClientResource(this.getUrl(this.propertyUtil.get(OasProps.PROP_BULK_FETCH_ANNOTATION_PATH, OasProps.DEF_BULK_FETCH_ANNOTATION_PATH))); final Representation results = getResource.get(MediaType.APPLICATION_RDF_XML); // Expecting HTTP 200 OK response Assert.assertEquals(200, getResource.getResponse().getStatus().getCode()); // Expecting application/json MIME type for response Assert.assertEquals(MediaType.APPLICATION_RDF_XML.getName(), results.getMediaType().getName()); final Model resultModel = this.assertRdf(results.getStream(), RDFFormat.RDFXML, 300); Assert.assertTrue(resultModel.contains(null, RDF.TYPE, OasConstants.TAGGING_TAGGING)); }