protected OptionDefinition( String cmdLineForm, String name ) { m_cmdLineForm = cmdLineForm; if (name != null) { m_prop = ResourceFactory.createProperty( NS, name ); } }
WildcardProperty() { super(ResourceFactory.createProperty( "_magic:ANY" )); }
private static Property property(String name) { return ResourceFactory.createProperty(NS+name) ; } /** <p>The namespace of the vocabulary as a string</p>
protected static final Property property(String name) { return ResourceFactory.createProperty(name); }
protected static final Property property(String name) { return ResourceFactory.createProperty(name); }
protected static final Property property(String name) { return ResourceFactory.createProperty(name); } }
private static final Property property(String local) { return ResourceFactory.createProperty(URI, local); }
public static Property property( String localName ) { return ResourceFactory.createProperty( uri + localName ); }
@Override public boolean apply(final String uri) { return isManagedPredicate.apply( createProperty(uri) ); } };
private static Property property(String URI, String local) { URI = OntologyResourceHelper.addResourceDelimiter(URI); return ResourceFactory.createProperty(URI, local); }
/** * @return The resource denoting the last page of results, or null */ public Resource lastPage() { return getResource( ResourceFactory.createProperty( XHV.ns + "last" ) ); }
private boolean isInstanceOfTheClass(Resource resource, Resource class_resource) { Property type_property = ResourceFactory.createProperty(Namespaces.RDF + "type"); if (resource == null || !resource.isResource()) return true; if (resource.hasProperty(type_property, class_resource)) return true; else return false; }
private boolean isInstanceOfTheClass(Resource resource, Resource class_resource) { Property type_property = ResourceFactory.createProperty(Namespaces.RDF + "type"); if (resource == null || !resource.isResource()) return true; if (resource.hasProperty(type_property, class_resource)) return true; else return false; }
private Property expand(String name) { String fullName = svc.expand(name); if (fullName == null) { throw new UnknownShortnameException(name); } return ResourceFactory.createProperty(fullName); } }
/** compact call to ReasonerRegistry.makeDirect */ private static final Property makeDirect( Property type ) { return ResourceFactory.createProperty( ReasonerRegistry.makeDirect( type.asNode().getURI() ) ); }
@Test public void testConstructsSimpleConfiguredQuery() { Property queryProperty = ResourceFactory.createProperty( "eh:/query" ); endpoint.addProperty( ELDA_API.textQueryProperty, queryProperty ); testConstructsSimpleSearchTriples(queryProperty); }
@Test public void testPathBeginsWith() { ShortnameService sns = Fixtures.shortNameServiceFixture(); ShortNameRenderer snr = new ShortNameRenderer( sns, null ); PropertyPath path = new PropertyPath( "name_p" ); assertTrue( path.beginsWith( ResourceFactory.createProperty( "http://example/test/p" ), snr ) ); assertFalse( path.beginsWith( ResourceFactory.createProperty( "http://example/test/q" ), snr ) ); path = new PropertyPath( "name_p.name_q" ); assertTrue( path.beginsWith( ResourceFactory.createProperty( "http://example/test/p" ), snr ) ); assertFalse( path.beginsWith( ResourceFactory.createProperty( "http://example/test/q" ), snr ) ); }
@Test public void testWildcardPathBeginsWith() { ShortnameService sns = Fixtures.shortNameServiceFixture(); ShortNameRenderer snr = new ShortNameRenderer( sns, null ); PropertyPath path = new PropertyPath( "*" ); assertTrue( path.beginsWith( ResourceFactory.createProperty( "http://example/test/p" ), snr ) ); assertTrue( path.beginsWith( ResourceFactory.createProperty( "http://example/test/q" ), snr ) ); path = new PropertyPath( "*.foo" ); assertTrue( path.beginsWith( ResourceFactory.createProperty( "http://example/test/p" ), snr ) ); assertTrue( path.beginsWith( ResourceFactory.createProperty( "http://example/test/q" ), snr ) ); }
@Test public void testEmptyPathBeginsWith() { ShortnameService sns = Fixtures.shortNameServiceFixture(); ShortNameRenderer snr = new ShortNameRenderer( sns, null ); PropertyPath path = new PropertyPath(); assertFalse( path.beginsWith( ResourceFactory.createProperty( "http://example/test/p" ), snr ) ); assertFalse( path.beginsWith( ResourceFactory.createProperty( "http://example/test/q" ), snr ) ); }
@Test public void testWithConfiguredOut() { TextSearchConfig ts = new TextSearchConfig( ResourceFactory.createProperty("absent:query") , TextSearchConfig.DEFAULT_CONTENT_PROPERTY , new AnyList() , true ); RDFQ.Triple query = RDFQ.triple(I, t, M); RDFQ.Triple plain = RDFQ.triple(I, P, M); List<Triple> them = Arrays.asList(plain, query); Reordered r = QuerySupport.reorder(them, ts); assertEquals(list(), r.textQueryTriples); assertEquals(list(plain, query), r.plainTriples); }