本文整理汇总了Java中com.complexible.common.rdf.model.Values类的典型用法代码示例。如果您正苦于以下问题:Java Values类的具体用法?Java Values怎么用?Java Values使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Values类属于com.complexible.common.rdf.model包,在下文中一共展示了Values类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internalEvaluate
import com.complexible.common.rdf.model.Values; //导入依赖的package包/类
@Override
protected Value internalEvaluate(final Value... values) throws ExpressionEvaluationException {
assertLiteral(values[0]);
assertLiteral(values[1]);
boolean normalizeStrings = false;
if(values.length == 3) {
if(!(getThirdArg() instanceof Constant)) {
throw new ExpressionEvaluationException("Parameter must be a constant expression");
}
normalizeStrings = EvalUtil.toBoolean(values[2].stringValue());
}
return Values.literal(iSub.score(values[0].stringValue(), values[1].stringValue(), normalizeStrings));
}
示例2: internalEvaluate
import com.complexible.common.rdf.model.Values; //导入依赖的package包/类
@Override
protected Value internalEvaluate(final Value... values) throws ExpressionEvaluationException {
final String firstString = assertStringLiteral(values[0]).stringValue();
final String secondString = assertStringLiteral(values[1]).stringValue();
if(values.length == 5) {
for(final Expression expression : getArgs()) {
// FIXME this should only check args 2-4 not all args
if(!(expression instanceof Constant)) {
throw new ExpressionEvaluationException("Parameters 2 through 5 must be constant expressions");
}
}
}
return Values.literal(getNeedlemanWunchFunction(values).compare(firstString, secondString));
}
示例3: explain
import com.complexible.common.rdf.model.Values; //导入依赖的package包/类
public void explain(String queryString)
throws TupleQueryResultHandlerException, QueryEvaluationException,
UnsupportedQueryResultFormatException, IOException{
TupleQueryResult aResult = this.client
.getAConn().select(queryString).execute();
ArrayList<Set<IRI>> graphIds = new ArrayList<Set<IRI>>();
while(aResult.hasNext()){
Value s = aResult.next().getValue("s");
Iterable<Proof> proofs = this.client.getAConn()
.explain(Values.statement(Values.iri(s.toString()),
Values.iri
("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
Values.iri
("http://swat.cse.lehigh.edu/onto/univ-bench.owl#Person")))
.computeNamedGraphs()
.proofs();
Iterator<Proof> proof_itr = proofs.iterator();
while(proof_itr.hasNext()) {
Proof aProof = proof_itr.next();
getGraphIDs(aProof, graphIds);
}
}
this.update(graphIds);
}
示例4: internalEvaluate
import com.complexible.common.rdf.model.Values; //导入依赖的package包/类
@Override
protected Value internalEvaluate(final Value... values) throws ExpressionEvaluationException {
final String firstString = assertStringLiteral(values[0]).stringValue();
final String secondString = assertStringLiteral(values[1]).stringValue();
return Values.literal(getSmithWatermanFunction(values).compare(firstString, secondString));
}
示例5: internalEvaluate
import com.complexible.common.rdf.model.Values; //导入依赖的package包/类
@Override
protected Value internalEvaluate(final Value... values) throws ExpressionEvaluationException {
final String string1 = assertStringLiteral(values[0]).stringValue();
final String string2 = assertStringLiteral(values[1]).stringValue();
if(string1.length() != string2.length()) {
throw new ExpressionEvaluationException("Argument lengths must be equal");
}
return Values.literal(distance(string1, string2));
}
示例6: internalEvaluate
import com.complexible.common.rdf.model.Values; //导入依赖的package包/类
@Override
protected Value internalEvaluate(final Value... values) throws ExpressionEvaluationException {
final String firstString = assertStringLiteral(values[0]).stringValue();
final String secondString = assertStringLiteral(values[1]).stringValue();
return Values.literal(getSmithWatermanGotohFunction().compare(firstString, secondString));
}
示例7: addModel
import com.complexible.common.rdf.model.Values; //导入依赖的package包/类
public void addModel(Model m, String graph_id) {
aConn.begin();
aConn.add().graph(m, Values.iri(graph_id));
aConn.commit();
}