本文整理汇总了Java中gate.creole.ontology.OConstants.ANNOTATION_PROPERTY属性的典型用法代码示例。如果您正苦于以下问题:Java OConstants.ANNOTATION_PROPERTY属性的具体用法?Java OConstants.ANNOTATION_PROPERTY怎么用?Java OConstants.ANNOTATION_PROPERTY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gate.creole.ontology.OConstants
的用法示例。
在下文中一共展示了OConstants.ANNOTATION_PROPERTY属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSetAnnotationProperties
/**
* This method returns the annotation properties set on this resource.
*
* @return
*/
public Set<AnnotationProperty> getSetAnnotationProperties() {
Property[] properties = ontologyService.getAnnotationProperties(
this.nodeId.toString());
Set<AnnotationProperty> annotProps = new HashSet<AnnotationProperty>();
for (int i = 0; i < properties.length; i++) {
if (properties[i].getType() != OConstants.ANNOTATION_PROPERTY) {
throw new GateOntologyException("The property :"
+ properties[i].getUri()
+ " returned from the repository is not an AnnotationProperty");
}
String propUri = properties[i].getUri();
OResource resource = null; //ontology.getOResourceFromMap(propUri);
if (resource == null) {
resource = new AnnotationPropertyImpl(ontology.createOURI(propUri),
this.ontology, ontologyService);
//ontology.addOResourceToMap(propUri, resource);
}
annotProps.add((AnnotationProperty) resource);
}
return annotProps;
}
示例2: createPropertyObject
private Property createPropertyObject(String uri)
throws GateOntologyException {
byte type = OConstants.ANNOTATION_PROPERTY;
if (isAnnotationProperty(uri)) {
type = OConstants.ANNOTATION_PROPERTY;
} else if (isObjectProperty(uri)) {
type = OConstants.OBJECT_PROPERTY;
} else if (isDatatypeProperty(uri)) {
type = OConstants.DATATYPE_PROPERTY;
} else if (isTransitiveProperty(uri)) {
type = OConstants.TRANSITIVE_PROPERTY;
} else if (isSymmetricProperty(uri)) {
type = OConstants.SYMMETRIC_PROPERTY;
} else if (isRDFProperty(uri)) {
type = OConstants.RDF_PROPERTY;
} else {
return null;
}
return new Property(type, uri);
}
示例3: getPropertyType
private byte getPropertyType(String aPropertyURI)
throws GateOntologyException {
if (isDatatypeProperty(aPropertyURI)) {
return OConstants.DATATYPE_PROPERTY;
} else if (isTransitiveProperty(aPropertyURI)) {
return OConstants.TRANSITIVE_PROPERTY;
} else if (isSymmetricProperty(aPropertyURI)) {
return OConstants.SYMMETRIC_PROPERTY;
} else if (isObjectProperty(aPropertyURI)) {
return OConstants.OBJECT_PROPERTY;
} else if (isAnnotationProperty(aPropertyURI)) {
return OConstants.ANNOTATION_PROPERTY;
} else {
return OConstants.RDF_PROPERTY;
}
}
示例4: getSetAnnotationProperties
/**
* This method returns the annotation properties set on this resource.
*
* @return
*/
public Set<AnnotationProperty> getSetAnnotationProperties() {
Property[] properties = ontologyService.getAnnotationProperties(
this.nodeId.toString());
Set<AnnotationProperty> annotProps = new HashSet<AnnotationProperty>();
for(int i = 0; i < properties.length; i++) {
if(properties[i].getType() != OConstants.ANNOTATION_PROPERTY) {
throw new GateOntologyException("The property :"
+ properties[i].getUri()
+ " returned from the repository is not an AnnotationProperty");
}
String propUri = properties[i].getUri();
OResource resource = null; //ontology.getOResourceFromMap(propUri);
if(resource == null) {
resource = new AnnotationPropertyImpl(ontology.createOURI(propUri),
this.ontology, ontologyService);
//ontology.addOResourceToMap(propUri, resource);
}
annotProps.add((AnnotationProperty)resource);
}
return annotProps;
}
示例5: createPropertyObject
private Property createPropertyObject(String uri)
throws GateOntologyException {
OURI ouri = ontology.createOURI(uri);
byte type = OConstants.ANNOTATION_PROPERTY;
if (isAnnotationProperty(ouri)) {
type = OConstants.ANNOTATION_PROPERTY;
} else if (isObjectProperty(ouri)) {
type = OConstants.OBJECT_PROPERTY;
} else if (isDatatypeProperty(ouri)) {
type = OConstants.DATATYPE_PROPERTY;
} else if (isTransitiveProperty(ouri)) {
type = OConstants.TRANSITIVE_PROPERTY;
} else if (isSymmetricProperty(ouri)) {
type = OConstants.SYMMETRIC_PROPERTY;
} else if (isRDFProperty(ouri)) {
type = OConstants.RDF_PROPERTY;
} else {
return null;
}
return new Property(type, uri);
}
示例6: getPropertyType
private byte getPropertyType(OURI aPropertyURI)
throws GateOntologyException {
if (isDatatypeProperty(aPropertyURI)) {
return OConstants.DATATYPE_PROPERTY;
} else if (isTransitiveProperty(aPropertyURI)) {
return OConstants.TRANSITIVE_PROPERTY;
} else if (isSymmetricProperty(aPropertyURI)) {
return OConstants.SYMMETRIC_PROPERTY;
} else if (isObjectProperty(aPropertyURI)) {
return OConstants.OBJECT_PROPERTY;
} else if (isAnnotationProperty(aPropertyURI)) {
return OConstants.ANNOTATION_PROPERTY;
} else {
return OConstants.RDF_PROPERTY;
}
}
示例7: loadAnnotationProperties
/**
*
*/
private void loadAnnotationProperties() {
Set<OWLAnnotationProperty> auris = new HashSet<OWLAnnotationProperty>();
for (OWLOntology o : ontologies) {
auris.addAll(o.getAnnotationPropertiesInSignature());
}
for (OWLAnnotationProperty u : auris) {
Property p = new Property(OConstants.ANNOTATION_PROPERTY, u.getIRI()
.toString());
annotationProperties.put(u, p);
}
}
示例8: createOProperty
/**
* Given required parameters, this method, based on the provided type,
* returns an appropriate object of a property.
*
* @param repositoryID
* @param ontology
* @param ontologyService
* @param uri
* @param type
* @return
*/
public static RDFProperty createOProperty(
Ontology ontology, OWLOntologyService ontologyService, String uri, byte type) {
// TODO: get rid of getOResourceFromMap here!
// Test simply commenting out for now
RDFProperty prop = null; // = (RDFProperty)ontology.getOResourceFromMap(uri);
//if(prop != null) return prop;
switch (type) {
case OConstants.ANNOTATION_PROPERTY:
return new AnnotationPropertyImpl(new OURIImpl(uri), ontology,
ontologyService);
case OConstants.RDF_PROPERTY:
return new RDFPropertyImpl(new OURIImpl(uri), ontology,
ontologyService);
case OConstants.OBJECT_PROPERTY:
return new ObjectPropertyImpl(new OURIImpl(uri), ontology,
ontologyService);
case OConstants.SYMMETRIC_PROPERTY:
return new SymmetricPropertyImpl(new OURIImpl(uri), ontology,
ontologyService);
case OConstants.TRANSITIVE_PROPERTY:
return new TransitivePropertyImpl(new OURIImpl(uri), ontology,
ontologyService);
case OConstants.DATATYPE_PROPERTY:
return new DatatypePropertyImpl(new OURIImpl(uri), ontology,
ontologyService);
default:
return null;
}
}