com.hp.hpl.jena.vocabulary.RDFS Java Examples

The following examples show how to use com.hp.hpl.jena.vocabulary.RDFS. 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: SemTime.java    From EventCoreference with Apache License 2.0 6 votes vote down vote up
public void addToJenaModelDocTimeInterval(Model model) {
    if (this.getPhraseCounts().size() > 0) {
        OwlTime owlTime = new OwlTime();
        owlTime.parsePublicationDate(getPhrase());
        owlTime.addToJenaModelOwlTimeInstant(model);

        Resource resource = model.createResource(this.getURI());
        for (int i = 0; i < this.getPhraseCounts().size(); i++) {
            PhraseCount phraseCount = this.getPhraseCounts().get(i);
            if (!phraseCount.getPhrase().isEmpty()) {
                resource.addProperty(RDFS.label, model.createLiteral(phraseCount.getPhrase()));
            }
        }

        resource.addProperty(RDF.type, Sem.Time);
        Resource interval = model.createResource(ResourcesUri.owltime + "Interval");
        resource.addProperty(RDF.type, interval);

        Resource value = model.createResource(owlTime.getDateStringURI());
        Property property = model.createProperty(ResourcesUri.owltime + "inDateTime");
        resource.addProperty(property, value);
    }
}
 
Example #2
Source File: GeneralMappingStyle.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
public GeneralMappingStyle(GeneralConnection connection, String baseIRI, String fileName) {
	this.baseIRI = baseIRI;
	this.fileName = fileName;
	if (this.baseIRI.endsWith("/")) {
		this.baseIRI = this.baseIRI.substring(0, this.baseIRI.length()-1);
	}
	this.vocabBaseIRI = this.baseIRI + "ontology#";
	this.geoBaseIRI = this.baseIRI;
	//this.geoBaseIRI = this.baseIRI + "/Geometry";
	if (fileName == null) {
		this.entityBaseIRI = this.baseIRI + "/Feature";
	}
	else {
		this.entityBaseIRI = this.baseIRI + "/" + fileName.substring(0, fileName.lastIndexOf('.'));
	}
	model.setNsPrefix("rdf", RDF.getURI());
	model.setNsPrefix("rdfs", RDFS.getURI());
	model.setNsPrefix("xsd", XSD.getURI());
	model.setNsPrefix("ogc", "http://www.opengis.net/ont/geosparql#");
	model.setNsPrefix("geof", "http://www.opengis.net/def/function/geosparql/");
	model.setNsPrefix("vocab", vocabBaseIRI);
	//model.setNsPrefix("tablename", vocabBaseIRI);
	generator = new GeneralMappingGenerator(this, connection);
}
 
Example #3
Source File: ClassMapServlet.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	D2RServer server = D2RServer.fromServletContext(getServletContext());
	server.checkMappingFileChanged();
	if (request.getPathInfo() == null) {
		new ModelResponse(classMapListModel(), request, response).serve();
		return;
	}
	String classMapName = request.getPathInfo().substring(1);
	Model resourceList = server.getMapping().getResourceCollection(classMapName).getInventoryModel();
	if (resourceList == null) {
		response.sendError(404, "Sorry, class map '" + classMapName + "' not found.");
		return;
	}
   	Resource classMap = resourceList.getResource(server.baseURI() + "all/" + classMapName);
   	Resource directory = resourceList.createResource(server.baseURI() + "all");
   	classMap.addProperty(RDFS.seeAlso, directory);
   	classMap.addProperty(RDFS.label, "List of all instances: " + classMapName);
   	directory.addProperty(RDFS.label, "D2R Server contents");
   	server.addDocumentMetadata(resourceList, classMap);
	new ModelResponse(resourceList, request, response).serve();
}
 
Example #4
Source File: ConceptImpl.java    From semanticMDR with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setParentConcept(ObjectClass parent) {
	if (parent != null) {
		this.addProperty(RDFS.subClassOf, parent.asMDRResource());
	} else {
		ExtendedIterator<OntClass> l = this.listSuperClasses();
		OntClass found = null;
		while (l.hasNext()) {
			OntClass ontClass = l.next();
			if (ontClass.hasSuperClass(mdrDatabase.getVocabulary().Concept)) {
				found = ontClass;
			}
		}
		if (found != null) {
			this.removeProperty(RDFS.subClassOf, found);
		}
	}
}
 
Example #5
Source File: D2RQMappingStyle.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
public D2RQMappingStyle(SQLConnection connection, String baseIRI, String fileName) {
	this.baseIRI = baseIRI;
	if (this.baseIRI.endsWith("/")) {
		this.baseIRI = this.baseIRI.substring(0, this.baseIRI.length()-1);
	}
	this.vocabBaseIRI = this.baseIRI + "ontology#";
	this.geoBaseIRI = this.baseIRI;
	this.entityBaseIRI = this.baseIRI;
	model.setNsPrefix("rdf", RDF.getURI());
	model.setNsPrefix("rdfs", RDFS.getURI());
	model.setNsPrefix("xsd", XSD.getURI());
	model.setNsPrefix("ogc", "http://www.opengis.net/ont/geosparql#");
	model.setNsPrefix("geof", "http://www.opengis.net/def/function/geosparql/");
	model.setNsPrefix("vocab", vocabBaseIRI);
	generator = new MappingGenerator(this, connection);
	generator.setGenerateLabelBridges(false);
	generator.setHandleLinkTables(true);
	generator.setGenerateDefinitionLabels(false);
	generator.setServeVocabulary(true);
	generator.setSkipForeignKeyTargetColumns(true);
	generator.setUseUniqueKeysAsEntityID(true);
}
 
Example #6
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);
	}
}
 
Example #7
Source File: SemObject.java    From EventCoreference with Apache License 2.0 5 votes vote down vote up
public void addToJenaOldBaileySimpleModel(SimpleTaxonomy simpleTaxonomy, HashMap<String, String> rename, Model model, Resource type) {
        Resource resource = model.createResource(this.getURI());
        Resource conceptResource = model.createResource(ResourcesUri.nwrontology+this.type);
        resource.addProperty(RDF.type, conceptResource);

        //// Top phrase
        String topLabel = this.getTopPhraseAsLabel();
        if (!topLabel.isEmpty()) {
            //Property property = model.createProperty(ResourcesUri.skos+SKOS.PREF_LABEL.getLocalName());
            //resource.addProperty(property, model.createLiteral(this.getTopPhraseAsLabel()));
            //// instead of

            if (type.equals(SemObject.EVENT) ) {
                resource = model.createResource(this.getURI() + "_" + topLabel);
                rename.put(this.getURI(), this.getURI() + "_" + topLabel);
            }
            for (int i = 0; i < phraseCounts.size(); i++) {
                PhraseCount phraseCount = phraseCounts.get(i);
                // resource.addProperty(RDFS.label, model.createLiteral(phraseCount.getPhraseCount()));
/*                if (!phraseCount.getPhrase().equalsIgnoreCase(getTopPhraseAsLabel()) && goodPhrase(phraseCount)) {
                    resource.addProperty(RDFS.label, model.createLiteral(phraseCount.getPhrase()));
                }*/
                if (goodPhrase(phraseCount)) {
                    resource.addProperty(RDFS.label, model.createLiteral(phraseCount.getPhrase()));
                }
            }
        }

        addAllConceptsToResourceForOldBailey(simpleTaxonomy, rename, resource, model);
        for (int i = 0; i < nafMentions.size(); i++) {
           NafMention nafMention = nafMentions.get(i);
           Property property = model.createProperty(ResourcesUri.gaf + "denotedBy");
           Resource targetResource = null;
           targetResource = model.createResource(nafMention.toStringFull());
           resource.addProperty(property, targetResource);
        }
    }
 
Example #8
Source File: SemTime.java    From EventCoreference with Apache License 2.0 5 votes vote down vote up
public void addToJenaModelTimeInterval(Model model) {
    this.getOwlTime().addToJenaModelOwlTimeInstant(model);

    Resource resource = model.createResource(this.getURI());
    for (int i = 0; i < this.getPhraseCounts().size(); i++) {
        PhraseCount phraseCount = this.getPhraseCounts().get(i);
        if (!phraseCount.getPhrase().isEmpty()) {
            resource.addProperty(RDFS.label, model.createLiteral(phraseCount.getPhrase()));
        }
    }

    resource.addProperty(RDF.type, Sem.Time);

    Resource interval = model.createResource(ResourcesUri.owltime + "Interval");
    resource.addProperty(RDF.type, interval);

    Resource value = model.createResource(this.getOwlTime().getDateStringURI());
    Property property = model.createProperty(ResourcesUri.owltime + "inDateTime");
    resource.addProperty(property, value);

    for (int i = 0; i < this.getNafMentions().size(); i++) {
        NafMention nafMention = this.getNafMentions().get(i);
        Property gaf = model.createProperty(ResourcesUri.gaf + "denotedBy");
        Resource targetResource = model.createResource(nafMention.toString());
        resource.addProperty(gaf, targetResource);

    }

}
 
Example #9
Source File: SemTime.java    From EventCoreference with Apache License 2.0 5 votes vote down vote up
public void addToJenaModelSimpleDocTimeInstant(Model model, SemObject semEvent) {

        this.getOwlTime().addToJenaModelOwlTimeInstant(model);

        Resource event = model.createResource(semEvent.getURI());
        Resource resource = model.createResource(this.getOwlTime().getDateStringURI());
        event.addProperty(Sem.hasTime, resource);

       // Resource resource = model.createResource(this.getURI());
        if (!this.getTopPhraseAsLabel().isEmpty()) {
            resource.addProperty(RDFS.label, model.createLiteral(this.getTopPhraseAsLabel()));
        }

        //resource.addProperty(RDF.type, Sem.Time);
        // System.out.println("this.getOwlTime().toString() = " + this.getOwlTime().toString());
/*
        Resource interval = model.createResource(ResourcesUri.owltime + "Instant");
        resource.addProperty(RDF.type, interval);
*/

/*
        Resource value = model.createResource(this.getOwlTime().getDateStringURI());
        Property property = model.createProperty(ResourcesUri.owltime + "inDateTime");
        resource.addProperty(property, value);
*/

    }
 
Example #10
Source File: SemTime.java    From EventCoreference with Apache License 2.0 5 votes vote down vote up
public void addToJenaModelDocTimeInstant(Model model) {

        this.getOwlTime().addToJenaModelOwlTimeInstant(model);

        Resource resource = model.createResource(this.getURI());
        if (!this.getTopPhraseAsLabel().isEmpty()) {
            resource.addProperty(RDFS.label, model.createLiteral(this.getTopPhraseAsLabel()));
        }

        /*for (int i = 0; i < phraseCounts.size(); i++) {
            PhraseCount phraseCount = phraseCounts.get(i);
            resource.addProperty(RDFS.label, model.createLiteral(phraseCount.getPhrase()));
        }*/

        //resource.addProperty(RDF.type, Sem.Time);
        // System.out.println("this.getOwlTime().toString() = " + this.getOwlTime().toString());
        Resource interval = model.createResource(ResourcesUri.owltime + "Instant");
        resource.addProperty(RDF.type, interval);

        Resource value = model.createResource(this.getOwlTime().getDateStringURI());
        Property property = model.createProperty(ResourcesUri.owltime + "inDateTime");
        resource.addProperty(property, value);

        for (int i = 0; i < this.getNafMentions().size(); i++) {
            NafMention nafMention = this.getNafMentions().get(i);
            Property gaf = model.createProperty(ResourcesUri.gaf + "denotedBy");
            Resource targetResource = model.createResource(nafMention.toString());
            resource.addProperty(gaf, targetResource);

        }
    }
 
Example #11
Source File: SemTime.java    From EventCoreference with Apache License 2.0 5 votes vote down vote up
public void addToJenaModelTimeInstant(Model model, OwlTime owlTime) {
    this.getOwlTime().addToJenaModelOwlTimeInstant(model);

    Resource resource = model.createResource(this.getURI());
    for (int i = 0; i < this.getPhraseCounts().size(); i++) {
        PhraseCount phraseCount = this.getPhraseCounts().get(i);
        if (!phraseCount.getPhrase().isEmpty()) {
            resource.addProperty(RDFS.label, model.createLiteral(phraseCount.getPhrase()));
        }
    }

    resource.addProperty(RDF.type, Sem.Time);

    Resource aResource = model.createResource(ResourcesUri.owltime + "Instant");
    resource.addProperty(RDF.type, aResource);

    Resource value = model.createResource(owlTime.getDateStringURI());
    Property property = model.createProperty(ResourcesUri.owltime + "inDateTime");
    resource.addProperty(property, value);

    for (int i = 0; i < this.getNafMentions().size(); i++) {
        NafMention nafMention = this.getNafMentions().get(i);
        Property gaf = model.createProperty(ResourcesUri.gaf + "denotedBy");
        Resource targetResource = model.createResource(nafMention.toString());
        resource.addProperty(gaf, targetResource);
    }
}
 
Example #12
Source File: ConceptImpl.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ObjectClass getParentConcept() {
	NodeIterator l = this.listPropertyValues(RDFS.subClassOf);

	while (l.hasNext()) {
		RDFNode res = l.nextNode();
		if (res.canAs(OntClass.class)) {
			OntClass ontClass = res.as(OntClass.class);
			if (ontClass.hasSuperClass(mdrDatabase.getVocabulary().Concept)) {
				return new ConceptImpl(res.asResource(), mdrDatabase);
			}
		}
	}
	return null;
}
 
Example #13
Source File: JenaUtils.java    From xcurator with Apache License 2.0 5 votes vote down vote up
public static List<Statement> getBestMatchingStatements(OntModel ontology, StringMetric metric, String term) {
    StmtIterator iter
            = ontology.listStatements(new SimpleSelector(null, RDFS.label, (RDFNode) null));

    double maxSimilarity = Double.MIN_VALUE;
    List<Statement> bestChoices = new LinkedList<Statement>();

    while (iter.hasNext()) {
        Statement st = iter.next();
        String objectStr = st.getObject().asLiteral().getString();

        double similarity = metric.getSimilarity(term, objectStr);

        if (similarity <= 0) {
            continue;
        }

        if (similarity > maxSimilarity) {
            maxSimilarity = similarity;
            bestChoices.clear();
        } else if (similarity == maxSimilarity) {
            bestChoices.add(st);
        }
    }

    return bestChoices;
}
 
Example #14
Source File: OpenCycOntology.java    From xcurator with Apache License 2.0 5 votes vote down vote up
public String getLabelForResource(String uri) {
    Resource subject = model.createResource(uri);
    Statement stmt = subject.getProperty(RDFS.label);
    if (stmt != null) {
        RDFNode object = stmt.getObject();
        return object == null ? "" : object.asLiteral().getString();
    } else {
        return "";
    }
}
 
Example #15
Source File: NeoGraph.java    From neo4jena with Apache License 2.0 5 votes vote down vote up
@Override
public PrefixMapping getPrefixMapping() {
	if(mapping==null)  {
		PrefixMapping standard = PrefixMapping.Factory.create()
			.setNsPrefix( "rdfs", RDFS.getURI() )
			.setNsPrefix( "rdf", RDF.getURI() )
			.setNsPrefix( "dc", DC_11.getURI() )
			.setNsPrefix( "owl", OWL.getURI() )
			.setNsPrefix( "xsd", XSD.getURI() );
		mapping = new NeoPrefixMapping(null, standard);
	}
	return mapping;
}
 
Example #16
Source File: GeneralResourceCollection.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
private Collection<GeneralTripleRelation> filterTripleRelations(Collection<GeneralTripleRelation> entityDescription) {
	List<GeneralTripleRelation> result = new ArrayList<GeneralTripleRelation>();
	for (GeneralTripleRelation triples: entityDescription) {
		triples = triples.orderBy(TripleRelation.SUBJECT, true);
		if (triples.selectTriple(new Triple(Node.ANY, RDF.Nodes.type, Node.ANY)) != null) {
			result.add(triples);
		}
		// TODO: The list of label properties is redundantly specified in PageServlet
		if (triples.selectTriple(new Triple(Node.ANY, RDFS.label.asNode(), Node.ANY)) != null) {
			result.add(triples);
		} else if (triples.selectTriple(new Triple(Node.ANY, SKOS.prefLabel.asNode(), Node.ANY)) != null) {
			result.add(triples);
		} else if (triples.selectTriple(new Triple(Node.ANY, DC.title.asNode(), Node.ANY)) != null) {
			result.add(triples);					
		} else if (triples.selectTriple(new Triple(Node.ANY, DCTerms.title.asNode(), Node.ANY)) != null) {
			result.add(triples);					
		} else if (triples.selectTriple(new Triple(Node.ANY, FOAF.name.asNode(), Node.ANY)) != null) {
			result.add(triples);					
		}
	}
	if (result.isEmpty()) {
		result.add(new GeneralTripleRelation(connection, entityTable, 
				entityMaker, 
				new FixedNodeMaker(RDF.type.asNode()), 
				new FixedNodeMaker(RDFS.Resource.asNode())));
	}
	return result;
}
 
Example #17
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 #18
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 #19
Source File: OntologyTarget.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
public void generateEntities(Resource class_, TableName table,
		TemplateValueMaker iriTemplate, List<Identifier> blankNodeColumns, boolean isGeometryTable) {
	if (class_ == null) return;
	Resource c = class_.inModel(model);
	c.addProperty(RDF.type, RDFS.Class);
	c.addProperty(RDF.type, OWL.Class);
	c.addProperty(RDFS.label, getLabel(table));
	if (generatedOntology != null) {
		c.addProperty(RDFS.isDefinedBy, generatedOntology);
	}
	classes.put(table, c);
}
 
Example #20
Source File: OntologyTarget.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
public OntologyTarget() {
	model.setNsPrefix("rdf", RDF.getURI());
	model.setNsPrefix("rdfs", RDFS.getURI());
	model.setNsPrefix("owl", OWL.getURI());
	model.setNsPrefix("dc", DC.getURI());
	model.setNsPrefix("xsd", XSD.getURI());
}
 
Example #21
Source File: ResourceCollection.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
private Collection<TripleRelation> filterTripleRelations(Collection<TripleRelation> entityDescription) {
	List<TripleRelation> result = new ArrayList<TripleRelation>();
	for (TripleRelation triples: entityDescription) {
		triples = triples.orderBy(TripleRelation.SUBJECT, true);
		if (triples.selectTriple(new Triple(Node.ANY, RDF.Nodes.type, Node.ANY)) != null) {
			result.add(triples);
		}
		// TODO: The list of label properties is redundantly specified in PageServlet
		if (triples.selectTriple(new Triple(Node.ANY, RDFS.label.asNode(), Node.ANY)) != null) {
			result.add(triples);
		} else if (triples.selectTriple(new Triple(Node.ANY, SKOS.prefLabel.asNode(), Node.ANY)) != null) {
			result.add(triples);
		} else if (triples.selectTriple(new Triple(Node.ANY, DC.title.asNode(), Node.ANY)) != null) {
			result.add(triples);					
		} else if (triples.selectTriple(new Triple(Node.ANY, DCTerms.title.asNode(), Node.ANY)) != null) {
			result.add(triples);					
		} else if (triples.selectTriple(new Triple(Node.ANY, FOAF.name.asNode(), Node.ANY)) != null) {
			result.add(triples);					
		}
	}
	if (result.isEmpty()) {
		result.add(new TripleRelation(sqlConnection, entityTable, 
				entityMaker, 
				new FixedNodeMaker(RDF.type.asNode()), 
				new FixedNodeMaker(RDFS.Resource.asNode())));
	}
	return result;
}
 
Example #22
Source File: Mapping.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
/**
 * Helper method to add definitions from a ResourceMap to its underlying resource
 * @param map
 * @param targetResource
 */
private void addDefinitions(ResourceMap map, Resource targetResource) {
	/* Infer rdfs:Class or rdf:Property type */
	Statement s = vocabularyModel.createStatement(targetResource, RDF.type, map instanceof ClassMap ? RDFS.Class : RDF.Property);
	if (!this.vocabularyModel.contains(s))
		this.vocabularyModel.add(s);

	/* Apply labels */
	for (Literal propertyLabel: map.getDefinitionLabels()) {
		s = vocabularyModel.createStatement(targetResource, RDFS.label, propertyLabel);
		if (!this.vocabularyModel.contains(s))
			this.vocabularyModel.add(s);
	}

	/* Apply comments */
	for (Literal propertyComment: map.getDefinitionComments()) {
		s = vocabularyModel.createStatement(targetResource, RDFS.comment, propertyComment);
		if (!this.vocabularyModel.contains(s))
			this.vocabularyModel.add(s);
	}

	/* Apply additional properties */
	for (Resource additionalProperty: map.getAdditionalDefinitionProperties()) {
		s = vocabularyModel.createStatement(targetResource, 
					(Property)(additionalProperty.getProperty(D2RQ.propertyName).getResource().as(Property.class)),
					additionalProperty.getProperty(D2RQ.propertyValue).getObject());
		if (!this.vocabularyModel.contains(s))
			this.vocabularyModel.add(s);				
	}
}
 
Example #23
Source File: ClassMapServlet.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
private Model classMapListModel() {
	D2RServer server = D2RServer.fromServletContext(getServletContext());
	Model result = ModelFactory.createDefaultModel();
	Resource list = result.createResource(server.baseURI() + "all");
	list.addProperty(RDFS.label, "D2R Server contents");
	for (String name: server.getMapping().getResourceCollectionNames()) {
		Resource instances = result.createResource(server.baseURI() + "all/" + name);
		list.addProperty(RDFS.seeAlso, instances);
		instances.addProperty(RDFS.label, "List of all instances: " + name);
	}
	server.addDocumentMetadata(result, list);
	return result;
}
 
Example #24
Source File: PageServlet.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
public static Statement getBestLabel(Resource resource) {
	Statement label = resource.getProperty(RDFS.label);
	if (label == null)
		label = resource.getProperty(SKOS.prefLabel);
	if (label == null)
		label = resource.getProperty(DC.title);
	if (label == null)
		label = resource.getProperty(DCTerms.title);
	if (label == null)
		label = resource.getProperty(FOAF.name);
	return label;
}
 
Example #25
Source File: John_BaseXMLWriter.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
void setupMaps() {
	nameSpaces.set11(RDF.getURI(), "rdf");
	nameSpaces.set11(RDFS.getURI(), "rdfs");
	nameSpaces.set11(DC.getURI(), "dc");
	nameSpaces.set11(RSS.getURI(), "rss");
	nameSpaces.set11("http://www.daml.org/2001/03/daml+oil.daml#", "daml");
	nameSpaces.set11(VCARD.getURI(), "vcard");
	nameSpaces.set11("http://www.w3.org/2002/07/owl#", "owl");
}
 
Example #26
Source File: R2RMLTarget.java    From GeoTriples with Apache License 2.0 4 votes vote down vote up
public void generateEntityLabels(TemplateValueMaker labelTemplate,
		TableName tableName) {
	addPredicateObjectMap(tableName, 
			createPredicateObjectMap(RDFS.label, 
					createTermMap(labelTemplate, TermType.LITERAL)));
}
 
Example #27
Source File: OntologyTarget.java    From GeoTriples with Apache License 2.0 4 votes vote down vote up
public void generateEntityLabels(TemplateValueMaker labelTemplate,
		TableName table) {
	model.add(RDFS.label, RDF.type, RDF.Property);
}
 
Example #28
Source File: RdbToRdf.java    From TripleGeo with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 
 * Insert a resource for a label
 */
private void insertLabelResource(String resource, String label, String lang) {
  Resource resource1 = model.createResource(resource);
  model.add(resource1, RDFS.label, model.createLiteral(label, lang));
}
 
Example #29
Source File: ShpConnector.java    From TripleGeo with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 
 * Handle label triples
 */
private void insertLabelResource(String resource, String label, String lang) 
{
  Resource resource1 = model.createResource(resource);
  model.add(resource1, RDFS.label, model.createLiteral(label, lang));
}
 
Example #30
Source File: D2RQTarget.java    From GeoTriples with Apache License 2.0 4 votes vote down vote up
public void generateEntityLabels(TemplateValueMaker labelTemplate, TableName table) {
	PropertyBridge bridge = new PropertyBridge(getLabelBridgeResource(table));
	bridge.setBelongsToClassMap(getClassMap(table));
	bridge.addProperty(RDFS.label);
	bridge.setPattern(Microsyntax.toString(labelTemplate));
}