本文整理汇总了Java中org.apache.jena.graph.Node.isBlank方法的典型用法代码示例。如果您正苦于以下问题:Java Node.isBlank方法的具体用法?Java Node.isBlank怎么用?Java Node.isBlank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.graph.Node
的用法示例。
在下文中一共展示了Node.isBlank方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTriple
import org.apache.jena.graph.Node; //导入方法依赖的package包/类
@Override
public void addTriple(CrawleableUri uri, Triple triple) {
String uriString = uri.getUri().toString();
if (rdfData.containsKey(uriString)) {
Model model = rdfData.get(uriString);
Resource s;
Node n = triple.getSubject();
if (n.isBlank()) {
s = model.createResource(new AnonId(triple.getSubject().getBlankNodeId()));
} else {
s = model.createResource(triple.getSubject().getURI());
}
Property p = model.createProperty(triple.getPredicate().getURI());
if (triple.getObject().isURI()) {
model.add(s, p, model.createResource(triple.getObject().getURI()));
} else if (triple.getObject().isBlank()) {
model.add(s, p, model.createResource(new AnonId(triple.getObject().getBlankNodeId())));
} else {
model.add(s, p, triple.getObject().getLiteralValue().toString());
}
} else {
LOGGER.error("Called to add a triple to the URI \"" + uriString + "\" which has never been opened.");
healthyness = false;
}
}
示例2: 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
示例3: extractNamespacesAndNames
import org.apache.jena.graph.Node; //导入方法依赖的package包/类
private void extractNamespacesAndNames() {
StmtIterator iter = model.listStatements();
while (iter.hasNext()) {
Statement r = iter.nextStatement();
Triple triple = r.asTriple();
Node[] nodes = new Node[2];
nodes[0] = triple.getPredicate();
nodes[1] = triple.getObject();
// nodes[2] = triple.getSubject();
for (int i = 0; i < 2; i++) {
Node node = nodes[i];
if (!node.isBlank() && !node.isLiteral() && node.isURI()) {
String uri = "";
try {
uri = node.getNameSpace();
addToMap(uri, node.getLocalName());
} catch (Exception e) {
}
}
}
}
}
示例4: format
import org.apache.jena.graph.Node; //导入方法依赖的package包/类
@Override
public void format(AWriter w, Node n)
{
if ( n.isBlank() )
formatBNode(w, n) ;
else
super.format(w, n);
}
示例5: format
import org.apache.jena.graph.Node; //导入方法依赖的package包/类
@Override
public void format(AWriter w, Node n) {
if ( n.isBlank() )
formatBNode(w, n) ;
else
super.format(w, n) ;
}
示例6: 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;
}
}
}