* the author's mbox, but must point to the Sioc:User node (it must be added).
* Foaf:Person pointing to the Sioc:User must be added as well.
* In other words: the statement from the graph must be removed, and two new must be added.
*/
while(statements.hasNext()) {
Statement stmt = statements.next();
tempModel.removeStatement(stmt);
/* given up, as a user doesn't have an account, Sioc:User does not intrduce any new information
//Sioc:User node
BNode bNode = graph.getValueFactory().createBNode();
graph.add(new StatementImpl(stmt.getSubject(), stmt.getPredicate(), bNode));
graph.add(new StatementImpl(bNode, valueFactory.createURI(XFOAF_SSCF.accountOf), valueFactory.createLiteral(stmt.getObject().toString())));
graph.add(new StatementImpl(bNode, valueFactory.createURI(RDF.TYPE), valueFactory.createURI(XFOAF_SSCF.User)));
//dodanie Foaf:Person holdsAccount
graph.add(new StatementImpl((Resource)stmt.getObject(), valueFactory.createURI(FOAF.maker), bNode));
*/
tempModel.addStatement(stmt.getSubject(),model.createURI(FOAF.maker.toString()),stmt.getObject());
tempModel.addStatement(stmt.getObject().asURI(), RDF.type, model.createURI(FOAF.Person.toString()));
Person tmpPerson = null;
for (Person p : authors) {
if (!addedAuthors.contains(p) && stmt.getObject().toString().equals(p.getMbox().toString())) {
tmpPerson = p;
break;
}
}
//System.out.println(s.getObject().toString());
if (tmpPerson != null) {
tempModel.addStatement(stmt.getObject().asURI(),model.createURI(FOAF.mbox.toString()),tmpPerson.getMbox().toString());
if (tmpPerson.getName() != null && !"".equals(tmpPerson.getName()) && !"nullnull".equals(tmpPerson.getName())) {
tempModel.addStatement(stmt.getObject().asURI(),model.createURI(FOAF.name.toString()),tmpPerson.getName());
}
if (tmpPerson.getGivenname() != null && !"".equals(tmpPerson.getGivenname())) {
tempModel.addStatement(stmt.getObject().asURI(),model.createURI(FOAF.givenname.toString()),tmpPerson.getGivenname());
}
if (tmpPerson.getFamily_name() != null && !"".equals(tmpPerson.getFamily_name())) {
tempModel.addStatement(stmt.getObject().asURI(),model.createURI(FOAF.family_name.toString()),tmpPerson.getFamily_name());
}
addedAuthors.add(tmpPerson);
}
}