@Override public String getVarName() { Property argProperty = getPredicate(); if(argProperty != null) { return argProperty.getLocalName(); } else { return null; } }
@Override public int compare(SHParameter param1, SHParameter param2) { Property p1 = param1.getPredicate(); Property p2 = param2.getPredicate(); if(p1 != null && p2 != null) { return p1.getLocalName().compareTo(p2.getLocalName()); } else { return 0; } } });
protected static int getIndex(final Property p) { if (p.getNameSpace().equals(RDF.getURI()) && p.getLocalName().startsWith("_")) { try { return Integer.parseInt(p.getLocalName().substring(1)); } catch (final NumberFormatException e) { // acceptable; } } return -1; }
@Override public int compare(SHParameter param1, SHParameter param2) { Property p1 = param1.getPredicate(); Property p2 = param2.getPredicate(); if(p1 != null && p2 != null) { return p1.getLocalName().compareTo(p2.getLocalName()); } else { return 0; } } });
@Override public String getVarName() { Property argProperty = getPredicate(); if(argProperty != null) { return argProperty.getLocalName(); } else { return null; } }
@Override public Map<String, SHParameter> getParametersMap() { Map<String,SHParameter> results = new HashMap<String,SHParameter>(); for(SHParameter parameter : getParameters()) { Property property = parameter.getPredicate(); if(property != null) { results.put(property.getLocalName(), parameter); } } return results; }
@Override public Map<String, SHParameter> getParametersMap() { Map<String,SHParameter> results = new HashMap<String,SHParameter>(); for(SHParameter parameter : getParameters()) { Property property = parameter.getPredicate(); if(property != null) { results.put(property.getLocalName(), parameter); } } return results; }
@SuppressWarnings("unchecked") public static void printPropertyValues(final Individual ind, final Property prop) { System.out.print(ind.getLocalName() + " has " + prop.getLocalName() + "(s): "); final ExtendedIterator<RDFNode> rsc = ind.listPropertyValues(prop); @SuppressWarnings("rawtypes") final ExtendedIterator<? extends Resource> rsc2 = (ExtendedIterator) rsc; // Resource extends RDFNode printIterator(rsc2); }
@SuppressWarnings("unchecked") public static void printPropertyValues(final Individual ind, final Property prop) { System.out.print(ind.getLocalName() + " has " + prop.getLocalName() + "(s): "); final ExtendedIterator<RDFNode> rsc = ind.listPropertyValues(prop); @SuppressWarnings("rawtypes") final ExtendedIterator<? extends Resource> rsc2 = (ExtendedIterator) rsc; // Resource extends RDFNode printIterator(rsc2); }
private NodeExpression createNodeExpression(Resource resource, Property predicate) { Statement s = resource.getProperty(predicate); if(s == null) { throw new IllegalArgumentException("Triple rule without " + predicate.getLocalName()); } return NodeExpressionFactory.get().create(s.getObject()); }
private NodeExpression createNodeExpression(Resource resource, Property predicate) { Statement s = resource.getProperty(predicate); if(s == null) { throw new IllegalArgumentException("Triple rule without " + predicate.getLocalName()); } return NodeExpressionFactory.get().create(s.getObject()); }
public StateBuilder replaceProperty(Property property, RDFNode value) { if (property == null) throw new IllegalArgumentException("Property cannot be null"); getResource().removeAll(property); getUriBuilder().replaceQueryParam(property.getLocalName(), (Object[])null); if (value != null) property(property, value); return this; }
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 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 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()); }