@Test public void testResourcesWithAllProperties() { List<Object> properties = new ArrayList<Object>(); List<DisplayRdfNode> rs = page.resourcesWithAllProperties( properties ); assertEquals( 0, rs.size() ); properties.add( "rdfs:label" ); rs = page.resourcesWithAllProperties( properties ); assertEquals( 31, rs.size() ); properties.add( "http: rs = page.resourcesWithAllProperties( properties ); assertEquals( 10, rs.size() ); properties.add( RDF.type ); rs = page.resourcesWithAllProperties( properties ); assertEquals( 10, rs.size() ); properties.add( RDF.first ); rs = page.resourcesWithAllProperties( properties ); assertEquals( 0, rs.size() ); }
public List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ) { List<DisplayRdfNode> rs = new ArrayList<DisplayRdfNode>(); if (!properties.isEmpty()) { Property p = toProperty( properties.get( 0 ) ); List<Resource> candidates = getModelW().getModel().listSubjectsWithProperty( p ).toList(); for (Object p1 : properties) { List<Resource> checked = new ArrayList<Resource>(); Property pp1 = toProperty( p1 ); for (Resource cand : candidates) { if (cand.hasProperty( pp1 )) { checked.add( cand ); } } candidates = checked; } for (Resource cand : candidates) { rs.add( new DisplayRdfNode( this, cand ) ); } } return rs; }
Page extends CommonNodeWrapper { public List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ) { List<DisplayRdfNode> rs = new ArrayList<DisplayRdfNode>(); if (!properties.isEmpty()) { Property p = toProperty( properties.get( 0 ) ); List<Resource> candidates = getModelW().getModel().listSubjectsWithProperty( p ).toList(); for (Object p1 : properties) { List<Resource> checked = new ArrayList<Resource>(); Property pp1 = toProperty( p1 ); for (Resource cand : candidates) { if (cand.hasProperty( pp1 )) { checked.add( cand ); } } candidates = checked; } for (Resource cand : candidates) { rs.add( new DisplayRdfNode( this, cand ) ); } } return rs; } }
Page extends CommonNodeWrapper { public List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ) { List<DisplayRdfNode> rs = new ArrayList<DisplayRdfNode>(); if (!properties.isEmpty()) { Property p = toProperty( properties.get( 0 ) ); List<Resource> candidates = getModelW().getModel().listSubjectsWithProperty( p ).toList(); for (Object p1 : properties) { List<Resource> checked = new ArrayList<Resource>(); Property pp1 = toProperty( p1 ); for (Resource cand : candidates) { if (cand.hasProperty( pp1 )) { checked.add( cand ); } } candidates = checked; } for (Resource cand : candidates) { rs.add( new DisplayRdfNode( this, cand ) ); } } return rs; } Page( ResultsModel mw, Resource root ); }
Page extends CommonNodeWrapper { public List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ) { List<DisplayRdfNode> rs = new ArrayList<DisplayRdfNode>(); if (!properties.isEmpty()) { Property p = toProperty( properties.get( 0 ) ); List<Resource> candidates = getModelW().getModel().listSubjectsWithProperty( p ).toList(); for (Object p1 : properties) { List<Resource> checked = new ArrayList<Resource>(); Property pp1 = toProperty( p1 ); for (Resource cand : candidates) { if (cand.hasProperty( pp1 )) { checked.add( cand ); } } candidates = checked; } for (Resource cand : candidates) { rs.add( new DisplayRdfNode( this, cand ) ); } } return rs; } Page( ResultsModel mw, Resource root ); void initialiseShortNameRenderer( ShortnameService sns ); ShortNameRenderer shortNameRenderer(); EldaURL pageURL(); boolean isItemEndpoint(); int pageNumber(); int itemsPerPage(); int totalResults(); String resultsCountSummary(); int startIndex(); Resource isPartOf(); Resource definition(); String extendedMetadataURL(); Resource firstPage(); Resource prevPage(); Resource nextPage(); Resource lastPage(); boolean hasPageData(); List<PageFormat> formats(); List<EldaView> views(); List<Binding<Resource>> termBindings(); List<Binding<String>> varBindings(); Map<String, String> varBindingsMap(); List<DisplayRdfNode> items(); Model pageObjectModel(); EldaView currentView(); EldaView findViewByName( String viewName ); PageMetadata metadata(); List<PropertyPath> currentPropertyPaths(); String pageTitle(); boolean itemHasAllProperties( List<Object> properties ); boolean itemHasAllProperties( Object... properties ); List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ); List<Link> filterRemovalLinks(); List<Link> sortRemovalLinks(); }
Page extends CommonNodeWrapper { public List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ) { List<DisplayRdfNode> rs = new ArrayList<DisplayRdfNode>(); if (!properties.isEmpty()) { Property p = toProperty( properties.get( 0 ) ); List<Resource> candidates = getModelW().getModel().listSubjectsWithProperty( p ).toList(); for (Object p1 : properties) { List<Resource> checked = new ArrayList<Resource>(); Property pp1 = toProperty( p1 ); for (Resource cand : candidates) { if (cand.hasProperty( pp1 )) { checked.add( cand ); } } candidates = checked; } for (Resource cand : candidates) { rs.add( new DisplayRdfNode( this, cand ) ); } } return rs; } Page( ResultsModel mw, Resource root ); void initialiseShortNameRenderer( ShortnameService sns ); ShortNameRenderer shortNameRenderer(); EldaURL pageURL(); boolean isItemEndpoint(); int pageNumber(); int itemsPerPage(); int totalResults(); String resultsCountSummary(); int startIndex(); Resource isPartOf(); Resource definition(); String extendedMetadataURL(); Resource firstPage(); Resource prevPage(); Resource nextPage(); Resource lastPage(); boolean hasPageData(); List<PageFormat> formats(); List<EldaView> views(); List<Binding<Resource>> termBindings(); List<Binding<String>> varBindings(); Map<String, String> varBindingsMap(); List<DisplayRdfNode> items(); Model pageObjectModel(); EldaView currentView(); EldaView findViewByName( String viewName ); PageMetadata metadata(); List<PropertyPath> currentPropertyPaths(); String pageTitle(); boolean itemHasAllProperties( List<Object> properties ); boolean itemHasAllProperties( Object... properties ); List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ); List<Link> filterRemovalLinks(); List<Link> sortRemovalLinks(); static final int NO_VALUE; static final String DEFAULT_VIEW_NAME; }