// Parse mapping file
MapParser parser = new MapParser(mapModel, "http://localhost:2020/");
Mapping mapping = parser.parse();
// Set up the GraphD2RQ
GraphD2RQ g = new GraphD2RQ(mapping);
// Create a find(spo) pattern
Node subject = Node.ANY;
Node predicate = DC.date.asNode();
Node object = Node.createLiteral("2003", null, XSDDatatype.XSDgYear);
Triple pattern = new Triple(subject, predicate, object);
// Query the graph
Iterator<Triple> it = g.find(pattern);
// Output query results
while (it.hasNext()) {
Triple t = it.next();
System.out.println("Published in 2003: " + t.getSubject());
}
g.close();
}