本文整理汇总了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);
}