當前位置: 首頁>>代碼示例>>Java>>正文


Java Triple.create方法代碼示例

本文整理匯總了Java中com.hp.hpl.jena.graph.Triple.create方法的典型用法代碼示例。如果您正苦於以下問題:Java Triple.create方法的具體用法?Java Triple.create怎麽用?Java Triple.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.hp.hpl.jena.graph.Triple的用法示例。


在下文中一共展示了Triple.create方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: creatRDF

import com.hp.hpl.jena.graph.Triple; //導入方法依賴的package包/類
private static void creatRDF(String[] line) {
    String s = line[0];
    String p = line[1];
    String o = line[2];

    Node nodeS = Node.createURI(s);
    Node nodeP = Node.createURI("<" + p + ">");
    Node nodeO = null;

    if (o.contains("http")) {
        nodeO = Node.createURI("<" + o + ">");
    } else if (o.contains(".")) {
        //double
        NodeFactoryExtra c = new NodeFactoryExtra();
        nodeO = c.doubleToNode(Double.parseDouble(o));
    } else {
        nodeO = Node.createLiteral(o);
    }
    Triple triple = Triple.create(nodeS, nodeS, nodeS);

    //Statement sta = ResourceFactory.createStatement(s, p, o);
    graph.add(triple);

}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:25,代碼來源:DataRdfizer.java

示例2: description

import com.hp.hpl.jena.graph.Triple; //導入方法依賴的package包/類
public Graph description() {
	if (executed) return result;
	executed = true;

	final QueryIterConcat qIter = new QueryIterConcat(context);
	Pingback<?> pingback = null;
	if (timeout > 0) {
		pingback = AlarmClock.get().add(new Callback<Object>() {
			public void proc(Object ignore) {
				qIter.cancel();
			}
		}, timeout);
	}
	
	FindQuery outgoing = new FindQuery(
			Triple.create(node, Node.ANY, Node.ANY), 
			mapping.compiledPropertyBridges(), limit, context);
	qIter.add(outgoing.iterator());
	
	if (!onlyOutgoing) {
		FindQuery incoming = new FindQuery(
				Triple.create(Node.ANY, Node.ANY, node), 
				mapping.compiledPropertyBridges(), limit, context);
		qIter.add(incoming.iterator());

		FindQuery triples = new FindQuery(
				Triple.create(Node.ANY, node, Node.ANY), 
				mapping.compiledPropertyBridges(), limit, context);
		qIter.add(triples.iterator());
	}
	result.getBulkUpdateHandler().add(TripleQueryIter.create(qIter));
	
	if (pingback != null) {
		AlarmClock.get().cancel(pingback);
	}
	
	return result;
}
 
開發者ID:aitoralmeida,項目名稱:c4a_data_repository,代碼行數:39,代碼來源:ResourceDescriber.java

示例3: description

import com.hp.hpl.jena.graph.Triple; //導入方法依賴的package包/類
public Graph description() {
	if (executed) return result;
	executed = true;

	log.info("Describing resource: " + node);

	ExecutionContext context = new ExecutionContext(
			mapping.getContext(), null, null, null);
	final QueryIterConcat qIter = new QueryIterConcat(context);
	Pingback<?> pingback = null;
	if (timeout > 0) {
		pingback = AlarmClock.get().add(new Callback<Object>() {
			public void proc(Object ignore) {
				qIter.cancel();
			}
		}, timeout);
	}
	
	FindQuery outgoing = new FindQuery(
			Triple.create(node, Node.ANY, Node.ANY), 
			mapping.getTripleRelations(), limit, context);
	qIter.add(outgoing.iterator());
	
	if (!onlyOutgoing) {
		FindQuery incoming = new FindQuery(
				Triple.create(Node.ANY, Node.ANY, node), 
				mapping.getTripleRelations(), limit, context);
		qIter.add(incoming.iterator());

		FindQuery triples = new FindQuery(
				Triple.create(Node.ANY, node, Node.ANY), 
				mapping.getTripleRelations(), limit, context);
		qIter.add(triples.iterator());
	}
	Iterator<Triple> it = TripleQueryIter.create(qIter);
	while (it.hasNext()) {
		result.add(it.next());
	}
	
	if (pingback != null) {
		AlarmClock.get().cancel(pingback);
	}
	
	return result;
}
 
開發者ID:d2rq,項目名稱:r2rml-kit,代碼行數:46,代碼來源:ResourceDescriber.java


注:本文中的com.hp.hpl.jena.graph.Triple.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。