public Model getAnonymousPropertyValues(String resourceURI, Property property, boolean isInverse) { String query = "DESCRIBE ?x WHERE { " + (isInverse ? "?x <" + property.getURI() + "> <" + resourceURI + "> . " : "<" + resourceURI + "> <" + property.getURI() + "> ?x . ") + "FILTER (isBlank(?x)) }"; Model result = execDescribeQuery(query); return result; }
protected String formatProperty(Property p) { String prop = p.getURI() ; if ( this.useWellKnownPropertySymbols && wellKnownPropsMap.containsKey(prop) ) return wellKnownPropsMap.get(prop); return formatURI(prop) ; }
protected String formatProperty(Property p) { String prop = p.getURI() ; if ( this.useWellKnownPropertySymbols && wellKnownPropsMap.containsKey(prop) ) return wellKnownPropsMap.get(prop); return formatURI(prop) ; }
public SameAsFilteringRDFServiceFactory(RDFServiceFactory rdfServiceFactory) { this.f = rdfServiceFactory; try { InputStream in = f.getRDFService().sparqlConstructQuery("CONSTRUCT { ?s <" + OWL.sameAs.getURI() + "> ?o } WHERE { ?s <" + OWL.sameAs.getURI() + "> ?o } ", ModelSerializationFormat.N3); sameAsModel = RDFServiceUtils.parseModel(in, ModelSerializationFormat.N3); } catch (RDFServiceException e) { throw new RuntimeException(e); } }
@Override public void addedStatement(Statement s) { if (!pipeOpen) return; // avoid stack overflow errors due to listening to our own changes pipeOpen = false; makeNewNamespaces(s); String predURI = s.getPredicate().getURI(); if (propertyURIsToListenFor.contains(predURI)) { rebuildNamespaceCache(); } pipeOpen = true; }
private void assertIsPropProperty( String name, Property p ) { assertEquals( ReasonerVocabulary.PropURI + "#" + name, p.getURI() ); } }
private void assertIsPropProperty( String name, Property p ) { assertEquals( ReasonerVocabulary.PropURI + "#" + name, p.getURI() ); } }
public void testCreateProperty() { final Property p1 = ResourceFactory .createProperty(TestResourceFactory.uri1); Assert.assertTrue(p1.getURI().equals(TestResourceFactory.uri1)); final Property p2 = ResourceFactory.createProperty( TestResourceFactory.uri1, "2"); Assert.assertTrue(p2.getURI().equals(TestResourceFactory.uri1 + "2")); }
public void testGetPropertyOneArg() { final String uri = "http://aldabaran.hpl.hp.com/rdf/test4/a" + 130; final Property p = model.getProperty(uri); Assert.assertEquals(uri, p.getURI()); }
public void testGetPropertyTwoArgs() { final String ns = "http://aldabaran.hpl.hp.com/rdf/test4/a" + 140 + "/"; final Property p = model.getProperty(ns, "foo"); Assert.assertEquals(ns + "foo", p.getURI()); }
public void testGetPropertyTwoArgs() { final String ns = "http://aldabaran.hpl.hp.com/rdf/test4/a" + 140 + "/"; final Property p = model.getProperty(ns, "foo"); Assert.assertEquals(ns + "foo", p.getURI()); }
public static String stmtString(Statement statement) { return " [subject = " + statement.getSubject().getURI() + "] [property = " + statement.getPredicate().getURI() + "] [object = " + (statement.getObject().isLiteral() ? ((Literal)statement.getObject()).getLexicalForm() + " (Literal)" : ((Resource)statement.getObject()).getURI() + " (Resource)") + "]"; }
public void testCreatePropertyTwoArgs() { final Property p = model.createProperty("abc/", "def"); Assert.assertEquals("abc/", p.getNameSpace()); Assert.assertEquals("def", p.getLocalName()); Assert.assertEquals("abc/def", p.getURI()); }
public void testCreatePropertyOneArg() { final Property p = model.createProperty("abc/def"); Assert.assertEquals("abc/", p.getNameSpace()); Assert.assertEquals("def", p.getLocalName()); Assert.assertEquals("abc/def", p.getURI()); }
public void testCreatePropertyOneArg() { final Property p = model.createProperty("abc/def"); Assert.assertEquals("abc/", p.getNameSpace()); Assert.assertEquals("def", p.getLocalName()); Assert.assertEquals("abc/def", p.getURI()); }
public void testCreatePropertyStrangeURI() { final String uri = RDF.getURI() + "_345"; final Property p = model.createProperty(uri); Assert.assertEquals(RDF.getURI(), p.getNameSpace()); Assert.assertEquals("_345", p.getLocalName()); Assert.assertEquals(uri, p.getURI()); }
public void testCreatePropertyStrangeURI() { final String uri = RDF.getURI() + "_345"; final Property p = model.createProperty(uri); Assert.assertEquals(RDF.getURI(), p.getNameSpace()); Assert.assertEquals("_345", p.getLocalName()); Assert.assertEquals(uri, p.getURI()); }
public void testCreatePropertyStrangeURITwoArgs() { final String local = "_345"; final Property p = model.createProperty(RDF.getURI(), local); Assert.assertEquals(RDF.getURI(), p.getNameSpace()); Assert.assertEquals(local, p.getLocalName()); Assert.assertEquals(RDF.getURI() + local, p.getURI()); }
public void testCreatePropertyStrangeURITwoArgs() { final String local = "_345"; final Property p = model.createProperty(RDF.getURI(), local); Assert.assertEquals(RDF.getURI(), p.getNameSpace()); Assert.assertEquals(local, p.getLocalName()); Assert.assertEquals(RDF.getURI() + local, p.getURI()); }