I'm new to Jena and the Semantic web.
I'm now making a model having an OntClass "Person" using Jena. This is what I've tried:
OntModel model = ModelFactory.createOntologyModel();
String NS = http://purl.org/ontology#
model.setNsPrefix("Ont", NS);
model.setNsPrefix("foaf", "http://xmlns.com/foaf/0.1#");
OntClass person = model.createClass(NS + "Person");
person.setSameAs(FOAF.Person);
person.addProperty(FOAF.account, "account");
But it doesn't seem working because when generating the Turtle file, I receive:
Ont:Person a owl:Class ;
owl:sameAs <http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/account>
"account" .
instead of having:
@prefix foaf: <http://xmlns.com/foaf/spec/#> .
Ont:Person a owl:Class ;
owl:sameAs foaf:Person ;
foaf:account "account" .
So what is the right way to link a OntClass in OntModel to a remote namespace ?in this case it's to link my OntClass person to "http://xmlns.com/foaf/0.1#"
Thank you in advance for your help!