CONSTRUCT {
?Person psn:firstName ?firstName ;
psn:lastName ?lastName ;
psn:contact ?Contact .
?Contact cnt:mobilePhone ?mobilePhone ;
cnt:addess ?address .
}WHERE {
?Person a psn:Person ;
psn:firstName "Luis" .
}
("http://domain.com/person/Luis_Smith", "http://domain.com/person/firstName", "Luis"^^<.../string>),
("http://domain.com/person/Luis_Smith", "http://domain.com/person/lastName", "Smith"^^<.../string>),
("http://domain.com/person/Luis_Smith", "http://domain.com/person/contact", "http://domain.com/contact/Luis_Smith_contact_1"),
("http://domain.com/person/Luis_Smith", "http://domain.com/person/contact", "http://domain.com/contact/Luis_Smith_contact_2"),
("http://domain.com/contact/Luis_Smith_contact_1", "http://domain.com/contact/address", "1st Street"^^<.../string>),
("http://domain.com/contact/Luis_Smith_contact_2", "http://domain.com/contact/address", "2st Street"^^<.../string>),
("http://domain.com/person/Luis_Jerssy", "http://domain.com/person/firstName", "Luis"^^<.../string>),
("http://domain.com/person/Luis_Jerssy", "http://domain.com/person/lastName", "Jerssy"^^<.../string>),
("http://domain.com/person/Luis_Jerssy", "http://domain.com/person/contact", "http://domain.com/contact/Luis_Jerssy_contact_1"),
("http://domain.com/person/Luis_Jerssy", "http://domain.com/person/contact", "http://domain.com/contact/Luis_Jerssy_contact_2"),
("http://domain.com/contact/Luis_Jerssy_contact_1", "http://domain.com/contact/address", "1st Street"^^<.../string>),
("http://domain.com/contact/Luis_Jerssy_contact_2", "http://domain.com/contact/address", "2st Street"^^<.../string>)
class Person
{
String firstName; //Luis
String lastName; //Smith
List<Contact> contacts; //1st Street, 2st Street
}
class Contact
{
String address; //1st Street
}
and so on...
Map<Resource, Model> models = new LinkedHashMap<>();
while (queryResult.hasNext())
{
Statement statement = queryResult.next();
Resource subject = statement.getSubject();
Model model = models.getOrDefault(subject, new LinkedHashModel());
model.add(statement);
models.put(subject, model);
}
> email to empire-rdf+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Empire" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/empire-rdf/kVRvXXwTeuM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to empire-rdf+unsubscribe@googlegroups.com.