Reputation: 13
I'm currently facing a problem and can't seem to find a solution in the net. In my project I have a RDF model with various smartphones, described like this:
<rdf:Description rdf:about="https://lukasgorny.pro/devices#GooglePixelXL2">
<device-name>Google Pixel XL2</device-name>
<screen-size>big</screen-size>
<primary-camera-resolution>13</primary-camera-resolution>
</rdf:Description>
Is there a way I'm able to find all devices in Apache Jena with, f.e. "screen-size" property set as "big"? Regards, Lukas.
Upvotes: 0
Views: 1431
Reputation: 166
Model m = RDFDataMgr.loadModel("phones.rdf", Lang.RDFXML);
m.listResourcesWithProperty(m.createProperty("screen-size"), m.createLiteral("big"))
.forEachRemaining(System.out::println);
prints them to console
Upvotes: 1