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


Java Node.equals方法代碼示例

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


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

示例1: selectNode

import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
public NodeMaker selectNode(Node node, RelationalOperators sideEffects) {
	if (node.equals(Node.ANY) || node.isVariable()) {
		return this;
	}
	if (!this.nodeType.matches(node)) {
		return NodeMaker.EMPTY;
	}
	String value = this.nodeType.extractValue(node);
	if (value == null) {
		return NodeMaker.EMPTY;
	}
	Expression expr = valueMaker.valueExpression(value);
	if (expr.isFalse()) {
		sideEffects.select(Expression.FALSE);
		return NodeMaker.EMPTY;
	}
	sideEffects.select(expr);
	return new FixedNodeMaker(node, isUnique());
}
 
開發者ID:aitoralmeida,項目名稱:c4a_data_repository,代碼行數:20,代碼來源:TypedNodeMaker.java

示例2: verifyValue

import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
@Override
protected QueryIterator verifyValue(Binding binding, Graph graph, Node product, Geometry geometry, Node object,
		ExecutionContext execCxt) {
	boolean b = false;
	try {
		if (product.getLocalName().equals("IfcWallStandardCase_5397")){
			System.out.println("");
		}
		HashSet<Geometry> allGeometries=getProcessableElements(graph);
		b = new ExternalQuadTreeImpl(geometry, allGeometries).getIsExternal();
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	Node node = NodeFactory.createLiteral(Boolean.toString(b), null, XSDDatatype.XSDboolean);
	if (node.equals(object)) {
		return IterLib.result(binding, execCxt);
	} else {
		return IterLib.noResults(execCxt);
	}
}
 
開發者ID:BenzclyZhang,項目名稱:BimSPARQL,代碼行數:22,代碼來源:IsOutsidePF.java

示例3: selectNode

import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
public NodeMaker selectNode(Node n, RelationalOperators sideEffects) {
	if (n.equals(this.node) || n.equals(Node.ANY) || n.isVariable()) {
		return this;
	}
	sideEffects.select(Expression.FALSE);
	return NodeMaker.EMPTY;
}
 
開發者ID:aitoralmeida,項目名稱:c4a_data_repository,代碼行數:8,代碼來源:FixedNodeMaker.java

示例4: instanceOf

import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
protected boolean instanceOf(Node node, Node clazz,Graph graph){
	ExtendedIterator<Triple> it=graph.find(node, RDF.type.asNode(), null);
	while(it.hasNext()) {
		Triple s = it.next();
			Node actualType = s.getObject();
			if(actualType.equals(clazz) || hasSuperClass(actualType, clazz,new HashSet<Node>(),graph)) {
				it.close();
				return true;
			}
	}
	return false;
}
 
開發者ID:BenzclyZhang,項目名稱:BimSPARQL,代碼行數:13,代碼來源:IsOutsidePF.java

示例5: hasSuperClass

import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
private static boolean hasSuperClass(Node subClass, Node superClass, Set<Node> reached,Graph graph) {
	for(Triple s : graph.find(subClass,RDFS.subClassOf.asNode(),null).toList()) {
		if(superClass.equals(s.getObject())) {
			return true;
		}
		else if(!reached.contains(s.getObject())) {
			reached.add(s.getObject());
			if(hasSuperClass(s.getObject(), superClass, reached,graph)) {
				return true;
			}
		}
	}
	return false;
}
 
開發者ID:BenzclyZhang,項目名稱:BimSPARQL,代碼行數:15,代碼來源:IsOutsidePF.java

示例6: convertToBoundingBox

import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
public void convertToBoundingBox(InputStream in, OutputStream out, String baseUri,boolean mvbb){
	setRdfWriter(new WriterStreamRDFBlocks(out));
	getRdfWriter().base(baseUri);
	getRdfWriter().prefix("inst", baseUri);
	getRdfWriter().prefix("rdf", Namespace.RDF);
	getRdfWriter().prefix("xsd", Namespace.XSD);
	getRdfWriter().prefix("owl", Namespace.OWL);
	getRdfWriter().prefix("geom", GEOM.getURI());
	getRdfWriter().start();

	getRdfWriter().finish();
		PipedRDFIterator<Triple> iter = new PipedRDFIterator<Triple>();
		final PipedRDFStream<Triple> stream = new PipedTriplesStream(iter);
		ExecutorService executor = Executors.newSingleThreadExecutor();
		Runnable parser = new Runnable() {
			public void run() {
				RDFDataMgr.parse(stream, in, RDFLanguages.TTL);
			}
		};
		executor.submit(parser);
		while (iter.hasNext()) {
			Triple t = iter.next();
			Node subject = t.getSubject();
			Node predicate = t.getPredicate();
			Node object = t.getObject();
			if(predicate.equals(GEOM.asBody.asNode())){
				Geometry g=EwktReader.parseGeometry((String)object.getLiteralValue());
				if(!g.isEmpty()){
				AABBVisitor av=new AABBVisitor();					
				g.accept(av);
				AABB aabb=av.getAABB();
				getRdfWriter().triple(new Triple(subject,GEOM.asAABB.asNode(),NodeFactory.createLiteral(EwktWriter.writeGeometry(aabb.toPolyhedralSurface()))));
				if(mvbb){
					MVBBVisitor mv=new MVBBVisitor();
					g.accept(mv);
					Box mvbbb=mv.getMVBB();
					getRdfWriter().triple(new Triple(subject,GEOM.asMVBB.asNode(),NodeFactory.createLiteral(EwktWriter.writeGeometry(mvbbb.toPolyhedralSurface()))));
				}
				}
			}

		}
		executor.shutdown();
		System.out.println("Model parsed!");	
		System.out.println("Finished!");
}
 
開發者ID:BenzclyZhang,項目名稱:BimSPARQL,代碼行數:47,代碼來源:BoundingBoxConverter.java


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