You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to RDF - I am attempting to updated RDF from the XMP section of JPEG images. The information is within an Iptc4xmpExt:LocationCreated element and then within an rdf:RBag element.
When read in the XMP data looks like this (provided as an attribute):
I am trying to filter a model to only hold the statements from node "b6538c1ef06545b68aa38c4f65ce305c53", which I can then update. I can find the NodeID which I am then filtering on Subject e.g. Resource rr1 = vf.createIRI("_:",nodeID). However the filter does not return any statements in bagModel1.
//filter to LocationCreated
Model iriFilter = model.filter(IRI_RESOURCE, IRI_LOCATIONCREATED, null);
if(iriFilter.size()==0) {
//to be completed
}
else
{
ValueFactory vf = SimpleValueFactory.getInstance();
Resource node = objectResource(iriFilter).orElse(null);
if(node != null) {
//Filter to RBAG
Collection<Statement> rdfBag= RDFContainers.getContainer(RDF.BAG,model, node, new ArrayList<Statement>());
for(Statement statement : rdfBag)
{
for(Statement listatement : rdfBag) {
Value ob = listatement.getObject();
String nodeID = ob.stringValue();
//need to find structure with object..
Resource rr1 = vf.createIRI("_:",nodeID);
Model bagModel1 = model.filter(rr1, null, null);
Rio.write(bagModel1, System.out, RDFFormat.RDFXML);
}
}
}
}
Is this the best approach is their an easier way of doing this ? I could not find any examples of this type of manipulation. Thanks for your help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am new to RDF - I am attempting to updated RDF from the XMP section of JPEG images. The information is within an Iptc4xmpExt:LocationCreated element and then within an rdf:RBag element.
When read in the XMP data looks like this (provided as an attribute):
Once read successfully into RDF4J - it looks like this:
I am trying to filter a model to only hold the statements from node "b6538c1ef06545b68aa38c4f65ce305c53", which I can then update. I can find the NodeID which I am then filtering on Subject e.g. Resource rr1 = vf.createIRI("_:",nodeID). However the filter does not return any statements in bagModel1.
Is this the best approach is their an easier way of doing this ? I could not find any examples of this type of manipulation. Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions