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


Java Node.isVariable方法代碼示例

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


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

示例1: processObject

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
private NPPhraseSpec processObject(Node object, boolean isClass) throws IOException {
	NPPhraseSpec element;
	if (object.isVariable()) {
		element = processVarNode(object);
	} else if (object.isLiteral()) {
		element = processLiteralNode(object);
	} else if (object.isURI()) {
		if (isClass) {
			element = processClassNode(object, false);
		} else {
			element = processResourceNode(object);
		}
	} else {
		throw new IllegalArgumentException("Can not convert blank node " + object + ".");
	}
	return element;
}
 
開發者ID:dice-group,項目名稱:RDF2PT,代碼行數:18,代碼來源:TripleConverterPortuguese.java

示例2: processObject

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
private NPPhraseSpec processObject(Node object, boolean isClass) {
	NPPhraseSpec element;
	if (object.isVariable()) {
		element = processVarNode(object);
	} else if (object.isLiteral()) {
		element = processLiteralNode(object);
	} else if (object.isURI()) {
		if (isClass) {
			element = processClassNode(object, false);
		} else {
			element = processResourceNode(object);
		}
	} else {
		throw new IllegalArgumentException("Can not convert blank node " + object + ".");
	}
	return element;
}
 
開發者ID:dice-group,項目名稱:BENGAL,代碼行數:18,代碼來源:TripleConverter.java

示例3: processNode

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
/**
 * Process the node and return an NLG element that contains the textual
 * representation. The output depends on the node type, i.e. variable, URI
 * or literal.
 * 
 * @param node
 *            the node to process
 * @return the NLG element containing the textual representation of the node
 * @throws IOException
 */
public NLGElement processNode(Node node) throws IOException {
	NLGElement element;
	if (node.isVariable()) {
		element = processVarNode(node);
	} else if (node.isURI()) {
		element = processResourceNode(node);
	} else if (node.isLiteral()) {
		element = processLiteralNode(node);
	} else {
		throw new UnsupportedOperationException("Can not convert blank node.");
	}
	return element;
}
 
開發者ID:dice-group,項目名稱:RDF2PT,代碼行數:24,代碼來源:TripleConverterPortuguese.java

示例4: processSubject

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
private NLGElement processSubject(Node subject) throws IOException {
	NLGElement element;
	if (subject.isVariable()) {
		element = processVarNode(subject);
	} else if (subject.isURI()) {
		element = processResourceNode(subject);
	} else if (subject.isLiteral()) {
		element = processLiteralNode(subject);
	} else {
		throw new UnsupportedOperationException("Can not convert " + subject);
	}
	return element;
}
 
開發者ID:dice-group,項目名稱:RDF2PT,代碼行數:14,代碼來源:TripleConverterPortuguese.java

示例5: compareNodes

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
public static int compareNodes(BiMap<Node, Node> baseIso, Node i, Node j) {
    int result = (
                    (i.isVariable() && j.isVariable()) ||
                    (i.isBlank() && j.isBlank() ||
                    Objects.equals(baseIso.get(i), j)))
            ? 0
            : NodeUtils.compareRDFTerms(i, j);

    return result;
}
 
開發者ID:SmartDataAnalytics,項目名稱:SubgraphIsomorphismIndex,代碼行數:11,代碼來源:SubgraphIsomorphismIndexJena.java

示例6: processNode

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
/**
 * Process the node and return an NLG element that contains the textual
 * representation. The output depends on the node type, i.e. variable, URI
 * or literal.
 * 
 * @param node
 *            the node to process
 * @return the NLG element containing the textual representation of the node
 */
public NLGElement processNode(Node node) {
	NLGElement element;
	if (node.isVariable()) {
		element = processVarNode(node);
	} else if (node.isURI()) {
		element = processResourceNode(node);
	} else if (node.isLiteral()) {
		element = processLiteralNode(node);
	} else {
		throw new UnsupportedOperationException("Can not convert blank node.");
	}
	return element;
}
 
開發者ID:dice-group,項目名稱:BENGAL,代碼行數:23,代碼來源:TripleConverter.java

示例7: processSubject

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
private NLGElement processSubject(Node subject) {
	NLGElement element;
	if (subject.isVariable()) {
		element = processVarNode(subject);
	} else if (subject.isURI()) {
		element = processResourceNode(subject);
	} else if (subject.isLiteral()) {
		element = processLiteralNode(subject);
	} else {
		throw new UnsupportedOperationException("Can not convert " + subject);
	}
	return element;
}
 
開發者ID:dice-group,項目名稱:BENGAL,代碼行數:14,代碼來源:TripleConverter.java

示例8: SourcePlanImpl

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
/**
 * The generation plan of a <code>{@code SOURCE <node> ACCEPT <mime> AS
 * <var>}</code> clause.
 *
 * @param node0 The IRI or the Variable node where a GET must be operated.
 * Must not be null.
 * @param accept0 The IRI or the Variable node that represent the accepted
 * Internet Media Type. May be null.
 * @param var0 The variable to bound the potentially retrieved document.
 * Must not be null.
 */
public SourcePlanImpl(
        final Node node0,
        final Node accept0,
        final Var var0) {
    Objects.requireNonNull(node0, "Node must not be null");
    Objects.requireNonNull(var0, "Var must not be null");
    if (!node0.isURI() && !node0.isVariable()) {
        throw new IllegalArgumentException("Source node must be a IRI or a"
                + " Variable. got " + node0);
    }
    this.node = node0;
    this.accept = accept0;
    this.var = var0;
}
 
開發者ID:thesmartenergy,項目名稱:sparql-generate,代碼行數:26,代碼來源:SourcePlanImpl.java

示例9: getQName

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
private String getQName(Node n, PrefixMapping m) {
    String name;
    if (n.isVariable()) {
        name = n.toString();
    } else {
        name = n.toString(m);
    }
    return name;
}
 
開發者ID:xgfd,項目名稱:ASPG,代碼行數:10,代碼來源:GraphViz.java

示例10: MotifFilter

import org.apache.jena.graph.Node; //導入方法依賴的package包/類
public MotifFilter(Node s, Node p, Node o) {
	this.s = s;
	this.p = p;
	this.o = o;
	
/*	if (!s.isConcrete()) {
		this.v = s.getName();
	}else {
		this.v=s.toString();
		v=v.substring(1, v.length()-1);	
	} */
	
	if (!s.isVariable()) {
		if (s.isLiteral()) {
			v=s.getLiteral().toString();
			vs=v;
		}else if (s.isURI()) {
			vs=s.getURI();
			PrefixBuilder subjectPrefix = new PrefixBuilder(s.getURI());
			v=subjectPrefix.getUriValue();
		}else if (s.isBlank()) {
			v = null;
		}
	}  
				
	if (!p.isVariable()) {
		if (p.isLiteral()) {
			e=p.getLiteral().toString();
			ep=e;
		}else if (p.isURI()) {
			ep=p.getURI();
			PrefixBuilder predicatePrefix = new PrefixBuilder(p.getURI());
			e= predicatePrefix.getUriValue();
		}else if (p.isBlank()) {
			e = null;
		}
	}
	if (!o.isVariable()) {
		if (o.isLiteral()) {
			v2=o.getLiteral().toString();
			v2o=v2;
		}else if (o.isURI()) {
			v2o=o.getURI();
			PrefixBuilder objectPrefix = new PrefixBuilder(o.getURI());
			v2=objectPrefix.getUriValue();
			
		}else if (o.isBlank()) {
			v2 = null;
		}
	}   
}
 
開發者ID:koneksys,項目名稱:SPARQL_to_GraphFrames,代碼行數:52,代碼來源:MotifFilter.java


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