use of org.openrdf.model.Resource in project vcell by virtualcell.
the class NamespaceAssimilator method smelt.
public Resource smelt(Graph rdf, Resource resource) {
Resource resourceMapped = resource;
if (!resources.contains(resource)) {
if (resource instanceof URI) {
URI uri = (URI) resource;
if (!namespace.equals(uri.getNamespace())) {
resourceMapped = resourceMap.get(resource);
if (resourceMapped == null) {
String localName = uri.getLocalName();
String localNameNew = localName;
resourceMapped = rdf.getValueFactory().createURI(namespace + localNameNew);
resourceMap.put(resource, resourceMapped);
}
}
} else {
resourceMapped = resourceMap.get(resource);
if (resourceMapped == null) {
resourceMapped = resource;
}
}
}
return resourceMapped;
}
use of org.openrdf.model.Resource in project vcell by virtualcell.
the class IndexedGraph method removeFromAllMaps.
protected void removeFromAllMaps(Statement statement) {
Resource subject = statement.getSubject();
URI predicate = statement.getPredicate();
Value object = statement.getObject();
removeFromMap(sMap, subject, statement);
removeFromMap(pMap, predicate, statement);
removeFromMap(oMap, object, statement);
removeFromMap(spMap, new ListOfTwo<Value>(subject, predicate), statement);
removeFromMap(soMap, new ListOfTwo<Value>(subject, object), statement);
removeFromMap(poMap, new ListOfTwo<Value>(predicate, object), statement);
}
use of org.openrdf.model.Resource 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);
}
use of org.openrdf.model.Resource 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);
}
use of org.openrdf.model.Resource 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);
}
}
Aggregations