当前位置: 首页>>代码示例>>Java>>正文


Java OWLAnnotationAssertionAxiom.getProperty方法代码示例

本文整理汇总了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;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:17,代码来源:ModelAnnotationSolrDocumentLoader.java

示例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;
	}
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:21,代码来源:SpeciesMergeUtil.java

示例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;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:34,代码来源:OWLGraphWrapperExtended.java

示例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;
}
 
开发者ID:geneontology,项目名称:minerva,代码行数:14,代码来源:LegoModelWalker.java

示例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;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:18,代码来源:Mooncat.java

示例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;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:40,代码来源:OWLGraphWrapperExtended.java


注:本文中的org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom.getProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。