Search in sources :

Example 6 with IRI

use of org.eclipse.rdf4j.model.IRI in project opentheso by miledrousset.

the class WriteRdf4j method writeRelation.

private void writeRelation(SKOSResource resource) {
    int prop;
    for (SKOSRelation relation : resource.getRelationsList()) {
        IRI uri = vf.createIRI(relation.getTargetUri());
        prop = relation.getProperty();
        switch(prop) {
            case SKOSProperty.member:
                builder.add(SKOS.MEMBER, uri);
                break;
            case SKOSProperty.broader:
                builder.add(SKOS.BROADER, uri);
                break;
            case SKOSProperty.broaderGeneric:
                builder.add("skos:broaderGeneric", uri);
                break;
            case SKOSProperty.broaderInstantive:
                builder.add("skos:broaderInstantive", uri);
                break;
            case SKOSProperty.broaderPartitive:
                builder.add("skos:broaderPartitive", uri);
                break;
            case SKOSProperty.narrower:
                builder.add(SKOS.NARROWER, uri);
                break;
            case SKOSProperty.narrowerGeneric:
                builder.add("skos:narrowerGeneric", uri);
                break;
            case SKOSProperty.narrowerInstantive:
                builder.add("skos:narrowerInstantive", uri);
                break;
            case SKOSProperty.narrowerPartitive:
                builder.add("skos:narrowerPartitive", uri);
                break;
            case SKOSProperty.related:
                builder.add(SKOS.RELATED, uri);
                break;
            case SKOSProperty.relatedHasPart:
                builder.add("skos:relatedHasPart", uri);
                break;
            case SKOSProperty.relatedPartOf:
                builder.add("skos:relatedPartOf", uri);
                break;
            case SKOSProperty.hasTopConcept:
                builder.add(SKOS.HAS_TOP_CONCEPT, uri);
                break;
            case SKOSProperty.inScheme:
                builder.add(SKOS.IN_SCHEME, uri);
                break;
            case SKOSProperty.topConceptOf:
                builder.add(SKOS.TOP_CONCEPT_OF, uri);
                break;
            case SKOSProperty.subGroup:
                builder.add("iso-thes:subGroup", uri);
                break;
            case SKOSProperty.microThesaurusOf:
                builder.add("iso-thes:microThesaurusOf", uri);
                break;
            case SKOSProperty.superGroup:
                builder.add("iso-thes:superGroup", uri);
                break;
        }
    }
}
Also used : IRI(org.eclipse.rdf4j.model.IRI) SKOSRelation(mom.trd.opentheso.skosapi.SKOSRelation)

Aggregations

IRI (org.eclipse.rdf4j.model.IRI)6 Literal (org.eclipse.rdf4j.model.Literal)4 Model (org.eclipse.rdf4j.model.Model)4 Statement (org.eclipse.rdf4j.model.Statement)4 Value (org.eclipse.rdf4j.model.Value)4 ModelBuilder (org.eclipse.rdf4j.model.util.ModelBuilder)3 Test (org.junit.Test)3 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 Date (java.util.Date)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 ValueFactory (org.eclipse.rdf4j.model.ValueFactory)2 SimpleValueFactory (org.eclipse.rdf4j.model.impl.SimpleValueFactory)2 JsonLdOptions (com.github.jsonldjava.core.JsonLdOptions)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 GregorianCalendar (java.util.GregorianCalendar)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 SKOSMatch (mom.trd.opentheso.skosapi.SKOSMatch)1