GeoPubby  Version 0.1.0.0
VocabularyStore.CachedPropertyCollection Class Reference
Collaboration diagram for VocabularyStore.CachedPropertyCollection:

Public Member Functions

Collection< Property > get ()
 
void reportAdditional (Property p)
 

Package Functions

 CachedPropertyCollection (Resource type)
 

Private Attributes

final Resource type
 
Collection< Property > cache = null
 

Constructor & Destructor Documentation

◆ CachedPropertyCollection()

CachedPropertyCollection ( Resource  type)
package
130  {
131  this.type = type;
132  }
final Resource type
Definition: VocabularyStore.java:128

References VocabularyStore.CachedPropertyCollection.type.

Member Function Documentation

◆ get()

Collection<Property> get ( )
133  {
134  if (dataSource == null) return Collections.emptyList();
135  if (cache != null) return cache;
136  cache = new ArrayList<Property>();
137  Model result = dataSource.listPropertyValues(type.getURI(), RDF.type, true);
138  StmtIterator it = result.listStatements(null, RDF.type, type);
139  while (it.hasNext()) {
140  Resource r = it.next().getSubject();
141  if (!r.isURIResource()) continue;
142  cache.add(r.as(Property.class));
143  }
144  return cache;
145  }
Model listPropertyValues(String resourceIRI, Property property, boolean isInverse)
Returns a subgraph of the data source.
DataSource dataSource
Definition: VocabularyStore.java:32
Collection< Property > cache
Definition: VocabularyStore.java:129

References VocabularyStore.CachedPropertyCollection.cache, VocabularyStore.dataSource, DataSource.listPropertyValues(), and VocabularyStore.CachedPropertyCollection.type.

Referenced by RemoteSPARQLDataSource.preProcessQuery().

◆ reportAdditional()

void reportAdditional ( Property  p)
146  {
147  if (cache == null) get();
148  if (cache.contains(p)) return;
149  cache.add(p);
150  }

References VocabularyStore.CachedPropertyCollection.cache.

Referenced by ResourceDescription.learnHighDegreeProperties().

Member Data Documentation

◆ cache

◆ type