本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObject.equals方法的典型用法代码示例。如果您正苦于以下问题:Java OWLObject.equals方法的具体用法?Java OWLObject.equals怎么用?Java OWLObject.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLObject
的用法示例。
在下文中一共展示了OWLObject.equals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateSimilarityAllByAll
import org.semanticweb.owlapi.model.OWLObject; //导入方法依赖的package包/类
public void calculateSimilarityAllByAll(String similarityAlgorithmName, Double minScore) throws SimilarityAlgorithmException {
Set<OWLObject> objs = graph.getAllOWLObjects();
if (comparisonSuperclass != null) {
System.out.println("finding descendants of :"+comparisonSuperclass);
objs = graph.getDescendants(comparisonSuperclass);
System.out.println(" descendants :"+objs.size());
}
for (OWLObject a : objs) {
if (excludeObjectFromComparison(a))
continue;
for (OWLObject b : graph.getAllOWLObjects()) {
if (a.equals(b))
continue;
if (excludeObjectFromComparison(b))
continue;
System.out.println("COMPARE:"+label(a)+" -vs- "+label(b));
Similarity s = this.getSimilarityAlgorithm(similarityAlgorithmName);
calculateSimilarity(s,a,b);
Double sc = s.score;
if (minScore == null || sc > minScore) {
System.out.println(a+" "+b+" = "+sc);
s.print();
}
}
}
}
示例2: render
import org.semanticweb.owlapi.model.OWLObject; //导入方法依赖的package包/类
public void render(OWLGraphWrapper g) {
if (isWriteHeader) {
print("IRI");
sep();
print("label");
sep();
print("definition");
nl();
}
graph = g;
Set<OWLObject> objs = new HashSet<OWLObject>(g.getSourceOntology().getClassesInSignature(Imports.EXCLUDED));
objs.addAll(g.getSourceOntology().getIndividualsInSignature(Imports.EXCLUDED));
for (OWLObject obj : objs) {
if (obj.equals(g.getDataFactory().getOWLNothing()))
continue;
if (obj.equals(g.getDataFactory().getOWLThing()))
continue;
if (obj instanceof OWLNamedObject)
render((OWLNamedObject)obj);
}
stream.close();
}
示例3: render
import org.semanticweb.owlapi.model.OWLObject; //导入方法依赖的package包/类
public void render(OWLGraphWrapper g) {
graph = g;
Set<OWLObject> objs = new HashSet<OWLObject>(g.getSourceOntology().getClassesInSignature(Imports.EXCLUDED));
objs.addAll(g.getSourceOntology().getIndividualsInSignature(Imports.EXCLUDED));
for (OWLObject obj : objs) {
if (obj.equals(g.getDataFactory().getOWLNothing()))
continue;
if (obj.equals(g.getDataFactory().getOWLThing()))
continue;
if (obj instanceof OWLNamedObject)
render((OWLNamedObject)obj);
}
stream.close();
}
示例4: isExcludeEdge
import org.semanticweb.owlapi.model.OWLObject; //导入方法依赖的package包/类
public boolean isExcludeEdge(OWLGraphEdge edge) {
if (config.graphEdgeExcludeSet != null ||
config.graphEdgeIncludeSet != null) {
for (OWLQuantifiedProperty qp : edge.getQuantifiedPropertyList()) {
if (isExcluded(qp)) {
LOG.debug("excluded:"+edge+" based on: "+qp);
return true;
}
}
}
OWLObject t = edge.getTarget();
if (t != null) {
if (t instanceof OWLNamedObject) {
OWLNamedObject nt = (OWLNamedObject) t;
// TODO
if (nt.getIRI().toString().startsWith("http://www.ifomis.org/bfo"))
return true;
if (t instanceof OWLClass && t.equals(getDataFactory().getOWLThing())) {
return true;
}
}
}
return false;
}
示例5: testDescendantsQuery
import org.semanticweb.owlapi.model.OWLObject; //导入方法依赖的package包/类
@Test
public void testDescendantsQuery() throws Exception {
OWLGraphWrapper g = getOntologyWrapper();
OWLClass c = g.getOWLClass("http://example.org#organism");
OWLObject i = g.getOWLObject("http://example.org#o1");
boolean ok = false;
for (OWLObject e : g.queryDescendants(c)) {
if (RENDER_ONTOLOGY_FLAG) {
System.out.println("ORG:" + e);
}
if (e.equals(i))
ok = true;
}
assertTrue(ok);
}
示例6: testDescendantsQuery
import org.semanticweb.owlapi.model.OWLObject; //导入方法依赖的package包/类
@Test
public void testDescendantsQuery() throws Exception {
OWLGraphWrapper g = getOntologyWrapper();
OWLClass c = g.getOWLClass("http://purl.obolibrary.org/obo/NCBITaxon_10090");
OWLObject i = g.getOWLObject("http://purl.obolibrary.org/obo/MGI_101761");
System.out.println("Expecting "+i);
boolean ok = false;
for (OWLObject e : g.queryDescendants(c)) {
System.out.println("ORG:"+e);
if (e.equals(i))
ok = true;
}
assertTrue(ok);
}
示例7: search
import org.semanticweb.owlapi.model.OWLObject; //导入方法依赖的package包/类
/**
* Given a query object (e.g. organism, disorder, gene), find candidate hit objects based
* on simple attribute overlap
*
* @param queryObj
* @return list of objects
*/
public List<OWLObject> search(OWLObject queryObj) {
List<OWLObject> hits = new ArrayList<OWLObject>(maxHits);
System.out.println("gettings atts for "+queryObj+" -- "+simEngine.comparisonProperty);
Set<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);
System.out.println("all atts: "+atts.size());
if (atts.size() == 0)
return hits;
// only compare using significant atts;
// we don't do the same test on candidates as these will be removed by the
// intersection operation. they will have a small effect on the score, as
// we don't divide by the union, but instead the sum of sizes
atts = filterNonSignificantAttributes(atts);
System.out.println("filtered atts: "+atts.size());
//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());
//bloomFilter.addAll(atts);
SortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();
for (OWLObject candidate : getCandidates()) {
if (candidate.equals(queryObj))
continue;
Set<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);
//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);
if (iAtts.size() == 0)
continue;
int cAttsSize = iAtts.size();
iAtts.retainAll(atts);
//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);
// simJ, one-sided, scaled by 1000
// negate to ensure largest first
//Integer score = - (iAtts.size() * 1000 / cAttsSize);
// this biases us towards genes with large numbers of annotations,
// but it is better at finding the models that share all features
Integer score = - iAtts.size();
if (!scoreCandidateMap.containsKey(score))
scoreCandidateMap.put(score, new HashSet<OWLObject>());
scoreCandidateMap.get(score).add(candidate);
reporter.report(this,"query_candidate_overlap_total",queryObj,candidate,iAtts.size(),cAttsSize);
}
int n = 0;
for (Set<OWLObject> cs : scoreCandidateMap.values()) {
n += cs.size();
hits.addAll(cs);
}
n = 0;
for (OWLObject hit : hits) {
n++;
reporter.report(this,"query_hit_rank_threshold",queryObj,hit,n,maxHits);
}
if (hits.size() > maxHits)
hits = hits.subList(0, maxHits);
return hits;
}