本文整理了Java中org.apache.clerezza.commons.rdf.Triple.getSubject()
方法的一些代码示例,展示了Triple.getSubject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Triple.getSubject()
方法的具体详情如下:
包路径:org.apache.clerezza.commons.rdf.Triple
类名称:Triple
方法名:getSubject
暂无
代码示例来源:origin: org.apache.clerezza/rdf.utils
private static Triple getTripleWithBlankNodeSubject(Graph triples) {
for (Triple triple : triples) {
if (triple.getSubject() instanceof BlankNode) {
return triple;
}
}
return null;
}
代码示例来源:origin: org.apache.clerezza/rdf.utils
private Set<IRI> getIfps(Graph tBox) {
final Iterator<Triple> ifpDefinitions = tBox.filter(null, RDF.type,
OWL.InverseFunctionalProperty);
final Set<IRI> ifps = new HashSet<IRI>();
while (ifpDefinitions.hasNext()) {
final Triple triple = ifpDefinitions.next();
ifps.add((IRI) triple.getSubject());
}
return ifps;
}
代码示例来源:origin: org.apache.clerezza.commons-rdf/commons-rdf-impl-utils
static Set<BlankNode> getBNodes(Collection<Triple> s) {
Set<BlankNode> result = new HashSet<BlankNode>();
for (Triple triple : s) {
if (triple.getSubject() instanceof BlankNode) {
result.add((BlankNode) triple.getSubject());
}
if (triple.getObject() instanceof BlankNode) {
result.add((BlankNode) triple.getObject());
}
}
return result;
}
代码示例来源:origin: org.apache.clerezza.commons-rdf/commons-rdf-impl-utils
private static boolean isGrounded(Triple triple) {
if (triple.getSubject() instanceof BlankNode) {
return false;
}
if (triple.getObject() instanceof BlankNode) {
return false;
}
return true;
}
代码示例来源:origin: apache/stanbol
public static Set<BlankNodeOrIRI> findRoots(Graph model) {
Set<BlankNodeOrIRI> roots = new HashSet<BlankNodeOrIRI>();
Set<BlankNodeOrIRI> visited = new HashSet<BlankNodeOrIRI>();
for (Triple t: model) {
BlankNodeOrIRI subj = t.getSubject();
findRoot(model, subj, roots, visited);
}
return roots;
}
代码示例来源:origin: org.apache.clerezza/rdf.utils
private static boolean isGrounded(Triple triple) {
if (triple.getSubject() instanceof BlankNode) {
return false;
}
if (triple.getObject() instanceof BlankNode) {
return false;
}
return true;
}
代码示例来源:origin: apache/clerezza
private Set<IRI> getIfps(Graph tBox) {
final Iterator<Triple> ifpDefinitions = tBox.filter(null, RDF.type,
OWL.InverseFunctionalProperty);
final Set<IRI> ifps = new HashSet<IRI>();
while (ifpDefinitions.hasNext()) {
final Triple triple = ifpDefinitions.next();
ifps.add((IRI) triple.getSubject());
}
return ifps;
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.enhancer.engines.htmlextractor
public static Set<BlankNodeOrIRI> findRoots(Graph model) {
Set<BlankNodeOrIRI> roots = new HashSet<BlankNodeOrIRI>();
Set<BlankNodeOrIRI> visited = new HashSet<BlankNodeOrIRI>();
for (Triple t: model) {
BlankNodeOrIRI subj = t.getSubject();
findRoot(model, subj, roots, visited);
}
return roots;
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.ontologymanager.multiplexer.clerezza
@Override
public Set<OWLOntologyID> getPublicKeys() {
Set<OWLOntologyID> result = new HashSet<OWLOntologyID>();
Iterator<Triple> it = meta.filter(null, RDF.type, ENTRY_URIREF);
while (it.hasNext()) {
RDFTerm obj = it.next().getSubject();
if (obj instanceof IRI) result.add(buildPublicKey((IRI) obj));
}
return result;
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.commons.security.core
private BlankNodeOrIRI getUserByName(String userName)
throws UserUnregisteredException {
Iterator<Triple> triples = systemGraph.filter(null, PLATFORM.userName,
new PlainLiteralImpl(userName));
if (triples.hasNext()) {
return triples.next().getSubject();
}
throw new UserUnregisteredException(userName);
}
代码示例来源:origin: apache/stanbol
private BlankNodeOrIRI getUserByName(String userName)
throws UserUnregisteredException {
Iterator<Triple> triples = systemGraph.filter(null, PLATFORM.userName,
new PlainLiteralImpl(userName));
if (triples.hasNext()) {
return triples.next().getSubject();
}
throw new UserUnregisteredException(userName);
}
代码示例来源:origin: org.apache.clerezza.commons-rdf/commons-rdf-impl-utils
private static Triple map(Triple triple, Map<BlankNode, BlankNode> map) {
final BlankNodeOrIRI oSubject = triple.getSubject();
BlankNodeOrIRI subject = oSubject instanceof BlankNode ?
map.get((BlankNode)oSubject) : oSubject;
RDFTerm oObject = triple.getObject();
RDFTerm object = oObject instanceof BlankNode ?
map.get((BlankNode)oObject) : oObject;
return new TripleImpl(subject, triple.getPredicate(), object);
}
代码示例来源:origin: org.apache.clerezza/rdf.jena.tdb.storage
private void removeDefaultGraphFromIndex() {
Graph index = graphNameIndex.getGraph();
Iterator<Triple> triplesToRemove = index.filter(null, RDF.type, Symbols.Default);
for( ; triplesToRemove.hasNext(); ) {
Triple triple = triplesToRemove.next();
triplesToRemove.remove();
removeFromIndex(IRI.class.cast(triple.getSubject()), Symbols.ImmutableGraph );
}
graphNameIndex.sync();
}
}
代码示例来源:origin: org.apache.clerezza.commons-rdf/commons-rdf-impl-utils
@Override
public boolean contains(Object o) {
if (!(o instanceof Triple)) {
return false;
}
Triple t = (Triple) o;
return filter(t.getSubject(), t.getPredicate(), t.getObject()).hasNext();
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.commons.indexedgraph
@Override
public int compare(Triple a, Triple b) {
int c = IndexedGraph.compare(a.getPredicate(), b.getPredicate(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getObject(), b.getObject(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getSubject(), b.getSubject(), hashCodeConflictMap);
}
}
return c;
}
};
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.commons.indexedgraph
@Override
public int compare(Triple a, Triple b) {
int c = IndexedGraph.compare(a.getSubject(), b.getSubject(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getPredicate(), b.getPredicate(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getObject(), b.getObject(), hashCodeConflictMap);
}
}
return c;
}
};
代码示例来源:origin: apache/stanbol
@Override
public int compare(Triple a, Triple b) {
int c = IndexedGraph.compare(a.getSubject(), b.getSubject(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getPredicate(), b.getPredicate(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getObject(), b.getObject(), hashCodeConflictMap);
}
}
return c;
}
};
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.commons.indexedgraph
@Override
public int compare(Triple a, Triple b) {
int c = IndexedGraph.compare(a.getObject(), b.getObject(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getSubject(), b.getSubject(), hashCodeConflictMap);
if (c == 0) {
c = IndexedGraph.compare(a.getPredicate(), b.getPredicate(), hashCodeConflictMap);
}
}
return c;
}
};
代码示例来源:origin: org.apache.clerezza/rdf.utils
private Triple toTargetTriple(Triple triple) {
if (triple == null) {
return null;
}
return new TripleImpl(toTargetRDFTerm(triple.getSubject()),
triple.getPredicate(), toTargetRDFTerm(triple.getObject()));
}
代码示例来源:origin: org.apache.clerezza/rdf.utils
private Triple toSourceTriple(Triple triple) {
if (triple == null) {
return null;
}
return new TripleImpl(toSourceRDFTerm(triple.getSubject()),
triple.getPredicate(), toSourceRDFTerm(triple.getObject()));
}
内容来源于网络,如有侵权,请联系作者删除!