Java Code Examples for com.hp.hpl.jena.rdf.model.Property#inModel()

The following examples show how to use com.hp.hpl.jena.rdf.model.Property#inModel() . 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: OntologyTarget.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
public void generateColumnProperty(Property property, TableName table,
		Identifier column, DataType datatype) {
	Property p = property.inModel(model);
	p.addProperty(RDF.type, RDF.Property);
	p.addProperty(RDF.type, OWL.DatatypeProperty);
	p.addProperty(RDFS.label, getLabel(table, column));
	domains.put(p, table);
	if (datatype.rdfType() != null && XSD.xstring.getURI().equals(datatype.rdfType())) {
		p.addProperty(RDFS.range, model.getResource(datatype.rdfType()));
	}
	if (generatedOntology != null) {
		p.addProperty(RDFS.isDefinedBy, generatedOntology);
	}
}
 
Example 2
Source File: OntologyTarget.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
public void generateRefProperty(Property property, TableName table,
		ForeignKey foreignKey) {
	Property p = property.inModel(model);
	p.addProperty(RDF.type, RDF.Property);
	p.addProperty(RDF.type, OWL.ObjectProperty);
	p.addProperty(RDFS.label, getLabel(table, foreignKey.getLocalColumns()));
	domains.put(p, table);
	ranges.put(p, foreignKey.getReferencedTable());
	if (generatedOntology != null) {
		p.addProperty(RDFS.isDefinedBy, generatedOntology);
	}
}
 
Example 3
Source File: OntologyTarget.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
public void generateLinkProperty(Property property, TableName table,
		ForeignKey fk1, ForeignKey fk2) {
	Property p = property.inModel(model);
	p.addProperty(RDF.type, RDF.Property);
	p.addProperty(RDF.type, OWL.ObjectProperty);
	p.addProperty(RDFS.label, getLabel(table));
	domains.put(p, fk1.getReferencedTable());
	ranges.put(p, fk2.getReferencedTable());
	if (generatedOntology != null) {
		p.addProperty(RDFS.isDefinedBy, generatedOntology);
	}
}