Search in sources :

Example 46 with URI

use of org.openrdf.model.URI in project vcell by virtualcell.

the class IndexedGraph method addToAllMaps.

protected void addToAllMaps(Statement statement) {
    Resource subject = statement.getSubject();
    URI predicate = statement.getPredicate();
    Value object = statement.getObject();
    addToMap(sMap, subject, statement);
    addToMap(pMap, predicate, statement);
    addToMap(oMap, object, statement);
    addToMap(spMap, new ListOfTwo<Value>(subject, predicate), statement);
    addToMap(soMap, new ListOfTwo<Value>(subject, object), statement);
    addToMap(poMap, new ListOfTwo<Value>(predicate, object), statement);
}
Also used : Resource(org.openrdf.model.Resource) Value(org.openrdf.model.Value) URI(org.openrdf.model.URI)

Example 47 with URI

use of org.openrdf.model.URI in project vcell by virtualcell.

the class SBPAX3Util method addSBTerm.

public static URI addSBTerm(Graph model, String baseURI, String term, String... refs) {
    URI sbTerm = model.getValueFactory().createURI(baseURI + "Term");
    model.add(sbTerm, RDF.TYPE, SBPAX3.SBVocabulary);
    int i = 0;
    if (refs.length % 2 == 1) {
        URI xRef = SBPAX3Util.addXRef(model, baseURI + "SBO" + "Ref", term, "SBO", refs[0]);
        model.add(sbTerm, BioPAX3.xref, xRef);
        ++i;
    }
    while (i < refs.length - 1) {
        URI xRef = SBPAX3Util.addXRef(model, baseURI + refs[i] + "Ref", term, refs[i], refs[i + 1]);
        model.add(sbTerm, BioPAX3.xref, xRef);
        i += 2;
    }
    model.add(sbTerm, BioPAX3.term, model.getValueFactory().createLiteral(term));
    return sbTerm;
}
Also used : URI(org.openrdf.model.URI)

Example 48 with URI

use of org.openrdf.model.URI in project vcell by virtualcell.

the class SBPAX3Util method addMichaelisMentenKineticsKmKcat.

public static void addMichaelisMentenKineticsKmKcat(Graph model, String NS, Resource catalysis, String index, double kM, double kCat) {
    URI kinetics = model.getValueFactory().createURI(NS + "kinetics" + index);
    model.add(kinetics, RDF.TYPE, SBPAX3.SBState);
    Resource michaelisMentenKinetics = SBPAX3Util.addSBTerm(model, NS + "michaelisMentenKinetics", "Henri-Michaelis-Menten rate law", "0000029");
    model.add(kinetics, SBPAX3.sbTerm, michaelisMentenKinetics);
    model.add(catalysis, SBPAX3.sbSubEntity, kinetics);
    Resource michaelisSubstrateConcentration = SBPAX3Util.addSBTerm(model, NS + "michaelisSubstrateConcentration", "Michaelis constant for substrate", "0000322", "MetaCyc", "Km");
    SBPAX3Util.addMeasurableSubEntity(model, NS + "kM" + index, kinetics, michaelisSubstrateConcentration, kM, UOMEList.MolePerMilligram);
    Resource catalyticRateConstant = SBPAX3Util.addSBTerm(model, NS + "catalyticRateConstant", "catalytic rate constant", "0000025", "MetaCyc", "kcat");
    SBPAX3Util.addMeasurableSubEntity(model, NS + "kCat" + index, kinetics, catalyticRateConstant, kCat, UOMEList.PerSecond);
}
Also used : Resource(org.openrdf.model.Resource) URI(org.openrdf.model.URI)

Example 49 with URI

use of org.openrdf.model.URI in project vcell by virtualcell.

the class SBPAX3Util method addSubEntity.

public static URI addSubEntity(Graph model, String uri, Resource parent, Resource sbTerm) {
    URI subEntity = model.getValueFactory().createURI(uri);
    model.add(subEntity, RDF.TYPE, SBPAX3.SBEntity);
    model.add(subEntity, SBPAX3.sbTerm, sbTerm);
    model.add(parent, SBPAX3.sbSubEntity, subEntity);
    return subEntity;
}
Also used : URI(org.openrdf.model.URI)

Example 50 with URI

use of org.openrdf.model.URI 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

URI (org.openrdf.model.URI)111 Test (org.junit.Test)28 SailConnection (org.openrdf.sail.SailConnection)25 Value (org.openrdf.model.Value)22 Statement (org.openrdf.model.Statement)21 NotifyingSailConnection (org.openrdf.sail.NotifyingSailConnection)21 Resource (org.openrdf.model.Resource)20 Literal (org.openrdf.model.Literal)14 ValueFactory (org.openrdf.model.ValueFactory)12 RepositoryException (org.openrdf.repository.RepositoryException)11 SailException (org.openrdf.sail.SailException)10 ShineRuntimeException (com.thoughtworks.studios.shine.ShineRuntimeException)8 Vertex (com.tinkerpop.blueprints.Vertex)7 HashSet (java.util.HashSet)7 Representation (org.apache.stanbol.entityhub.servicesapi.model.Representation)7 Model (org.openrdf.model.Model)7 URIImpl (org.openrdf.model.impl.URIImpl)7 Edge (com.tinkerpop.blueprints.Edge)6 BNode (org.openrdf.model.BNode)6 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)6