本文整理匯總了Java中com.hp.hpl.jena.graph.Node.isVariable方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.isVariable方法的具體用法?Java Node.isVariable怎麽用?Java Node.isVariable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.hp.hpl.jena.graph.Node
的用法示例。
在下文中一共展示了Node.isVariable方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getMappingVarsOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
HashMap<String, String[]> result = new HashMap<String, String[]>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if (subject.isVariable())
result.put(subject.getName(),
new String[] { Tags.SUBJECT_COLUMN_NAME });
if (predicate.isVariable()) {
result.put(predicate.getName(),
new String[] { Tags.PREDICATE_COLUMN_NAME });
}
if (object.isVariable()) {
result.put(object.getName(),
new String[] { Tags.OBJECT_COLUMN_NAME });
}
return result;
}
示例2: getSchemaOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
protected ArrayList<String> getSchemaOfTriple(Triple t) {
ArrayList<String> schema = new ArrayList<String>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if (subject.isVariable())
schema.add(subject.getName());
else
schema.add(Tags.NO_VAR);
if (predicate.isVariable())
schema.add(predicate.getName());
else
schema.add(Tags.NO_VAR);
if (object.isVariable())
schema.add(object.getName());
else
schema.add(Tags.NO_VAR);
return schema;
}
示例3: getMappingVarsOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
HashMap<String, String[]> result = new HashMap<String, String[]>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if (subject.isVariable()) {
result.put(subject.getName(), new String[] { Tags.SUBJECT_COLUMN_NAME });
}
if (predicate.isVariable()) {
selectFromTripleStore = true;
result.put(predicate.getName(), new String[] { Tags.PREDICATE_COLUMN_NAME });
}
if (object.isVariable()) {
if (selectFromTripleStore) {
result.put(object.getName(), new String[] { Tags.OBJECT_COLUMN_NAME });
} else {
String objectString = object.getName();
String predicateString = getPropertyFromURI(FmtUtils
.stringForNode(predicate, prefixMapping), false);
result.put(objectString, new String[] { SpecialCharFilter.filter(predicateString) });
}
}
return result;
}
示例4: getMappingVarsOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
HashMap<String, String[]> result = new HashMap<String, String[]>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if (subject.isVariable())
result.put(subject.getName(),
new String[] { Tags.SUBJECT_COLUMN_NAME });
if (predicate.isVariable()) {
selectFromTripleStore = true;
result.put(predicate.getName(),
new String[] { Tags.PREDICATE_COLUMN_NAME });
}
if (object.isVariable()) {
if (selectFromTripleStore) {
result.put(object.getName(),
new String[] { Tags.OBJECT_COLUMN_NAME });
} else {
result.put(object.getName(), new String[] { SpecialCharFilter
.filter(FmtUtils
.stringForNode(predicate, prefixMapping)) });
}
}
return result;
}
示例5: toString
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
/**
* Pretty-prints an RDF node and shortens URIs into QNames according to a
* {@link PrefixMapping}.
* @param n An RDF node
* @return An N-Triples style textual representation with URIs shortened to QNames
*/
public static String toString(Node n, PrefixMapping prefixes) {
if (n.isURI()) {
return qNameOrURI(n.getURI(), prefixes);
}
if (n.isBlank()) {
return "_:" + n.getBlankNodeLabel();
}
if (n.isVariable()) {
return "?" + n.getName();
}
if (Node.ANY.equals(n)) {
return "?ANY";
}
// Literal
String s = "\"" + n.getLiteralLexicalForm() + "\"";
if (!"".equals(n.getLiteralLanguage())) {
s += "@" + n.getLiteralLanguage();
}
if (n.getLiteralDatatype() != null) {
s += "^^" + qNameOrURI(n.getLiteralDatatypeURI(), prefixes);
}
return s;
}
示例6: 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());
}
示例7: limitTo
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
public void limitTo(Node node) {
if (isEmpty) return;
if (Node.ANY.equals(node) || node.isVariable()) {
return;
}
if (fixedNode == null) {
fixedNode = node;
} else if (!fixedNode.equals(node)) {
limitToEmptySet();
}
if (node.isURI()) {
limitToURIs();
limitValues(node.getURI());
}
if (node.isBlank()) {
limitToBlankNodes();
limitValues(node.getBlankNodeLabel());
}
if (node.isLiteral()) {
limitToLiterals(node.getLiteralLanguage(), node.getLiteralDatatype());
limitValues(node.getLiteralLexicalForm());
}
}
示例8: getVarsOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
private ArrayList<String> getVarsOfTriple(Triple t) {
ArrayList<String> vars = new ArrayList<String>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if(subject.isVariable())
vars.add(subject.getName());
if(predicate.isVariable())
vars.add(predicate.getName());
if(object.isVariable())
vars.add(object.getName());
return vars;
}
示例9: getVarsOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
protected ArrayList<String> getVarsOfTriple(Triple t) {
ArrayList<String> vars = new ArrayList<String>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if (subject.isVariable())
vars.add(subject.getName());
if (predicate.isVariable())
vars.add(predicate.getName());
if (object.isVariable())
vars.add(object.getName());
return vars;
}
示例10: getVarsOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
private ArrayList<String> getVarsOfTriple(Triple t) {
ArrayList<String> vars = new ArrayList<String>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if(subject.isVariable())
vars.add(subject.getName());
if(predicate.isVariable())
vars.add(predicate.getName());
if(object.isVariable())
vars.add(object.getName());
return vars;
}
示例11: getMappingVarsOfTriple
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
/**
* From a triple the method extracts the variable names
* and the columns to be selected from the table referring to that variable.
*
* @param t
* @return
*/
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
HashMap<String, String[]> result = new HashMap<String, String[]>();
Node subject = t.getSubject();
Node predicate = t.getPredicate();
Node object = t.getObject();
if (subject.isVariable()){
result.put(subject.getName(),
new String[] { Tags.SUBJECT_COLUMN_NAME });
}
if (predicate.isVariable()) {
selectFromTripleStore = true;
result.put(predicate.getName(),
new String[] { Tags.PREDICATE_COLUMN_NAME });
}
if (object.isVariable()) {
if (selectFromTripleStore) {
result.put(object.getName(),
new String[] { Tags.OBJECT_COLUMN_NAME });
} else {
String objectString = object.getName();
String predicateString = getPropertyFromURI(FmtUtils
.stringForNode(predicate, prefixMapping), false);
result.put(objectString, new String[] { SpecialCharFilter
.filter(predicateString) });
}
}
return result;
}
示例12: 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;
}
示例13: visit
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
private void visit(Node node) {
if (node == null) return;
if (node.isVariable()) {
variables.add((Var) node);
}
}
示例14: addIfVariable
import com.hp.hpl.jena.graph.Node; //導入方法依賴的package包/類
public void addIfVariable(Node possibleVariable, NodeMaker nodeMaker, AliasMap aliases) {
if (!possibleVariable.isVariable()) return;
add((Var) possibleVariable, nodeMaker, aliases);
}