use of com.hp.hpl.jena.rdf.model.SimpleSelector in project ambit-mirror by ideaconsult.
the class RDFIteratingReader method parseFeatureValues.
protected void parseFeatureValues(Resource dataEntry, IStructureRecord record) throws Exception {
StmtIterator values = jenaModel.listStatements(new SimpleSelector(dataEntry, OT.OTProperty.values.createProperty(jenaModel), (RDFNode) null));
while (values.hasNext()) {
Statement st = values.next();
if (st.getObject().isResource()) {
Resource fv = (Resource) st.getObject();
Statement property = fv.getProperty(OT.DataProperty.value.createProperty(jenaModel));
RDFNode value = null;
if (property != null)
value = property.getObject();
RDFNode feature = fv.getProperty(OT.OTProperty.feature.createProperty(jenaModel)).getObject();
Property key = null;
String uri = null;
if (feature.isURIResource() && (lookup != null)) {
uri = ((Resource) feature).getURI();
key = lookup.get(uri);
}
if (key == null) {
key = propertyIterator.parseRecord(feature, key);
if (uri != null) {
if (lookup == null)
lookup = new Hashtable<String, Property>();
lookup.put(uri, key);
}
}
if (value != null)
setFeatureValue(record, key, value);
}
}
}
Aggregations