本文整理匯總了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;
}
}
}