Search in sources :

Example 1 with SetOfThree

use of org.sbpax.util.sets.SetOfThree in project vcell by virtualcell.

the class OntologyInfo method resourcesFromStatement.

public static Set<Resource> resourcesFromStatement(Statement statement) {
    Resource subject = statement.getSubject();
    URI predicate = statement.getPredicate();
    Value object = statement.getObject();
    if (object instanceof Resource) {
        return new SetOfThree<Resource>(subject, predicate, (Resource) object);
    } else {
        return new SetOfTwo<Resource>(subject, predicate);
    }
}
Also used : SetOfTwo(org.sbpax.util.sets.SetOfTwo) SetOfThree(org.sbpax.util.sets.SetOfThree) Resource(org.openrdf.model.Resource) Value(org.openrdf.model.Value) URI(org.openrdf.model.URI)

Aggregations

Resource (org.openrdf.model.Resource)1 URI (org.openrdf.model.URI)1 Value (org.openrdf.model.Value)1 SetOfThree (org.sbpax.util.sets.SetOfThree)1 SetOfTwo (org.sbpax.util.sets.SetOfTwo)1