Java Code Examples for org.apache.jena.ontology.Individual#addProperty()

The following examples show how to use org.apache.jena.ontology.Individual#addProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractRdfEntityGraphConsumer.java    From baleen with Apache License 2.0 6 votes vote down vote up
private ObjectProperty addRelationToModel(OntModel model, Edge e) {
  Individual source = model.getIndividual(namespace + e.outVertex().id());
  Individual target = model.getIndividual(namespace + e.inVertex().id());
  ObjectProperty property = model.getObjectProperty(namespace + e.label());

  if (source != null && target != null && property != null) {
    source.addProperty(property, target);
    return property;
  } else {
    getMonitor()
        .warn(
            "Missing individuals {} or {} or relation {}",
            e.outVertex(),
            e.inVertex(),
            e.label());
    return null;
  }
}
 
Example 2
Source File: ROEvoSerializer.java    From incubator-taverna-language with Apache License 2.0 5 votes vote down vote up
private void addPrevious(OntModel model,
		Revision revision, Revision previous) {
	OntClass VersionableResource = model.createClass("http://purl.org/wf4ever/roevo#VersionableResource");
	VersionableResource.addSuperClass(prov.Entity);
	
	Individual revisionResource = model.createIndividual(revision.getIdentifier().toASCIIString(), 
			VersionableResource);
	Individual previousResource = model.createIndividual(previous.getIdentifier().toASCIIString(), 
			VersionableResource);
	revisionResource.addProperty(prov.wasRevisionOf, previousResource);
}
 
Example 3
Source File: AbstractRdfDocumentGraphConsumer.java    From baleen with Apache License 2.0 5 votes vote down vote up
private ObjectProperty addRelationToModel(OntModel model, Edge e) {
  Individual source = model.getIndividual(namespace + e.outVertex().id());
  Individual target = model.getIndividual(namespace + e.inVertex().id());

  ObjectProperty property = model.getObjectProperty(namespace + e.label());
  source.addProperty(property, target);

  return property;
}