本文整理汇总了Java中org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OWLAnnotationAssertionAxiom.getProperty方法的具体用法?Java OWLAnnotationAssertionAxiom.getProperty怎么用?Java OWLAnnotationAssertionAxiom.getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom
的用法示例。
在下文中一共展示了OWLAnnotationAssertionAxiom.getProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderAnnotationAxioms
import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; //导入方法依赖的package包/类
private Map<String, Object> renderAnnotationAxioms(Set<OWLAnnotationAssertionAxiom> annotations) {
Map<String, Object> result = null;
if (annotations != null && !annotations.isEmpty()) {
for (OWLAnnotationAssertionAxiom ax : annotations) {
OWLAnnotationProperty prop = ax.getProperty();
String literal = getLiteralValue(ax.getValue());
if (literal != null) {
if (result == null) {
result = new HashMap<String, Object>();
}
result.put(prop.toStringID(), literal);
}
}
}
return result;
}
示例2: tr
import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; //导入方法依赖的package包/类
private OWLAxiom tr(OWLClass c, OWLAnnotationAssertionAxiom ax) {
OWLAnnotationProperty p = ax.getProperty();
if (!ecmap.containsKey(c)) {
// preserve as-is, exception for labels
if (p.isLabel()) {
OWLLiteral lit = (OWLLiteral) ax.getValue();
String newVal = lit.getLiteral() + " (" + suffix + ")";
return fac.getOWLAnnotationAssertionAxiom(ax.getProperty(),
ax.getSubject(), fac.getOWLLiteral(newVal));
}
return ax;
} else {
// the class is merged - ditch its axioms
// (in future some may be preserved - syns?)
// fac.getOWLAnnotationAssertionAxiom(ax.getProperty(), ecmap,
// ax.getValue());
return null;
}
}
示例3: getAllOWLObjectsByAltId
import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; //导入方法依赖的package包/类
/**
* Find all corresponding {@link OWLObject}s with an OBO-style alternate identifier.
* <p>
* WARNING: This methods scans all object annotations in all ontologies.
* This is an expensive method.
*
* @return map of altId to OWLObject (never null)
*/
public Map<String, OWLObject> getAllOWLObjectsByAltId() {
final Map<String, OWLObject> results = new HashMap<String, OWLObject>();
final OWLAnnotationProperty altIdProperty = getAnnotationProperty(OboFormatTag.TAG_ALT_ID.getTag());
if (altIdProperty == null) {
return Collections.emptyMap();
}
for (OWLOntology o : getAllOntologies()) {
Set<OWLAnnotationAssertionAxiom> aas = o.getAxioms(AxiomType.ANNOTATION_ASSERTION);
for (OWLAnnotationAssertionAxiom aa : aas) {
OWLAnnotationValue v = aa.getValue();
OWLAnnotationProperty property = aa.getProperty();
if (altIdProperty.equals(property) && v instanceof OWLLiteral) {
String altId = ((OWLLiteral)v).getLiteral();
OWLAnnotationSubject subject = aa.getSubject();
if (subject instanceof IRI) {
OWLObject obj = getOWLObject((IRI) subject);
if (obj != null) {
results.put(altId, obj);
}
}
}
}
}
return results;
}
示例4: extractMetadata
import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; //导入方法依赖的package包/类
private Metadata extractMetadata(OWLNamedIndividual individual, OWLGraphWrapper modelGraph, String modelId) {
Metadata metadata = new Metadata();
metadata.modelId = modelId;
metadata.individualIds = new HashSet<IRI>();
metadata.individualIds.add(individual.getIRI());
Set<OWLAnnotationAssertionAxiom> assertionAxioms = modelGraph.getSourceOntology().getAnnotationAssertionAxioms(individual.getIRI());
for (OWLAnnotationAssertionAxiom axiom : assertionAxioms) {
OWLAnnotationProperty currentProperty = axiom.getProperty();
OWLAnnotationValue value = axiom.getValue();
extractMetadata(currentProperty, value, metadata);
}
return metadata;
}
示例5: isImportMarkedEntity
import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; //导入方法依赖的package包/类
/**
* Check, if the named object has the annotation property IAO:0000412,
* declaring the object as imported.
*
* @param named
* @param ontology
* @return true if the item has the annotation property IAO:0000412
*/
public static boolean isImportMarkedEntity(OWLNamedObject named, OWLOntology ontology) {
for (OWLAnnotationAssertionAxiom axiom : ontology.getAnnotationAssertionAxioms(named.getIRI())) {
OWLAnnotationProperty property = axiom.getProperty();
if (importedMarkerIRI.equals(property.getIRI())) {
return true;
}
}
return false;
}
示例6: getOWLObjectsByAltId
import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; //导入方法依赖的package包/类
/**
* Find the corresponding {@link OWLObject}s for a given set of OBO-style alternate identifiers.
* <p>
* WARNING: This methods scans all object annotations in all ontologies.
* This is an expensive method.
* <p>
* Consider loading all altId-mappings using {@link #getAllOWLObjectsByAltId()}.
*
* @param altIds
* @return map of altId to OWLObject (never null)
* @see #getAllOWLObjectsByAltId()
*/
public Map<String, OWLObject> getOWLObjectsByAltId(Set<String> altIds) {
final Map<String, OWLObject> results = new HashMap<String, OWLObject>();
final OWLAnnotationProperty altIdProperty = getAnnotationProperty(OboFormatTag.TAG_ALT_ID.getTag());
if (altIdProperty == null) {
return Collections.emptyMap();
}
for (OWLOntology o : getAllOntologies()) {
Set<OWLAnnotationAssertionAxiom> aas = o.getAxioms(AxiomType.ANNOTATION_ASSERTION);
for (OWLAnnotationAssertionAxiom aa : aas) {
OWLAnnotationValue v = aa.getValue();
OWLAnnotationProperty property = aa.getProperty();
if (altIdProperty.equals(property) && v instanceof OWLLiteral) {
String altId = ((OWLLiteral)v).getLiteral();
if (altIds.contains(altId)) {
OWLAnnotationSubject subject = aa.getSubject();
if (subject instanceof IRI) {
OWLObject obj = getOWLObject((IRI) subject);
if (obj != null) {
results.put(altId, obj);
}
}
}
}
}
}
return results;
}