Search in sources :

Example 6 with NodeHieraRelation

use of mom.trd.opentheso.bdd.helper.nodes.NodeHieraRelation in project opentheso by miledrousset.

the class ExportRdf4jHelper method addRelationGiven.

private void addRelationGiven(ArrayList<NodeHieraRelation> btList, ArrayList<NodeHieraRelation> ntList, ArrayList<NodeHieraRelation> rtList, SKOSResource resource, String idTheso) {
    for (NodeHieraRelation rt : rtList) {
        int prop;
        switch(rt.getRole()) {
            case "RHP":
                prop = SKOSProperty.relatedHasPart;
                break;
            case "RPO":
                prop = SKOSProperty.relatedPartOf;
                break;
            default:
                prop = SKOSProperty.related;
        }
        resource.addRelation(getUriFromNodeUri(rt.getUri(), idTheso), prop);
    }
    for (NodeHieraRelation nt : ntList) {
        int prop;
        switch(nt.getRole()) {
            case "NTG":
                prop = SKOSProperty.narrowerGeneric;
                break;
            case "NTP":
                prop = SKOSProperty.narrowerPartitive;
                break;
            case "NTI":
                prop = SKOSProperty.narrowerInstantive;
                break;
            default:
                prop = SKOSProperty.narrower;
        }
        resource.addRelation(getUriFromNodeUri(nt.getUri(), idTheso), prop);
    }
    for (NodeHieraRelation bt : btList) {
        int prop;
        switch(bt.getRole()) {
            case "BTG":
                prop = SKOSProperty.broaderGeneric;
                break;
            case "BTP":
                prop = SKOSProperty.broaderPartitive;
                break;
            case "BTI":
                prop = SKOSProperty.broaderInstantive;
                break;
            default:
                prop = SKOSProperty.broader;
        }
        resource.addRelation(getUriFromNodeUri(bt.getUri(), idTheso), prop);
    }
}
Also used : NodeHieraRelation(mom.trd.opentheso.bdd.helper.nodes.NodeHieraRelation)

Aggregations

NodeHieraRelation (mom.trd.opentheso.bdd.helper.nodes.NodeHieraRelation)6 NodeUri (mom.trd.opentheso.bdd.helper.nodes.NodeUri)4 ArrayList (java.util.ArrayList)3 NodeConceptExport (mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport)3 Concept (mom.trd.opentheso.bdd.datas.Concept)2 NodeAlignment (mom.trd.opentheso.bdd.helper.nodes.NodeAlignment)2 NodeConcept (mom.trd.opentheso.bdd.helper.nodes.concept.NodeConcept)2 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 RelationsHelper (mom.trd.opentheso.bdd.helper.RelationsHelper)1 NodeEM (mom.trd.opentheso.bdd.helper.nodes.NodeEM)1 NodeGps (mom.trd.opentheso.bdd.helper.nodes.NodeGps)1 NodeLang (mom.trd.opentheso.bdd.helper.nodes.NodeLang)1 NodeNote (mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote)1 NodeSearch (mom.trd.opentheso.bdd.helper.nodes.search.NodeSearch)1 NodeTermTraduction (mom.trd.opentheso.bdd.helper.nodes.term.NodeTermTraduction)1