当前位置: 首页>>代码示例>>Java>>正文


Java Values类代码示例

本文整理汇总了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));
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:17,代码来源:ISub.java

示例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));
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:18,代码来源:NeedlemanWunch.java

示例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);
}
 
开发者ID:raymondino,项目名称:SequentialStreamReasoningArchitecture,代码行数:25,代码来源:StardogCache.java

示例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));
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:9,代码来源:SmithWaterman.java

示例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));
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:13,代码来源:HammingDistance.java

示例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));
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:9,代码来源:SmithWatermanGotoh.java

示例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();
}
 
开发者ID:raymondino,项目名称:SequentialStreamReasoningArchitecture,代码行数:6,代码来源:SnarlClient.java


注:本文中的com.complexible.common.rdf.model.Values类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。