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


Java OConstants.DATATYPE_PROPERTY属性代码示例

本文整理汇总了Java中gate.creole.ontology.OConstants.DATATYPE_PROPERTY属性的典型用法代码示例。如果您正苦于以下问题:Java OConstants.DATATYPE_PROPERTY属性的具体用法?Java OConstants.DATATYPE_PROPERTY怎么用?Java OConstants.DATATYPE_PROPERTY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在gate.creole.ontology.OConstants的用法示例。


在下文中一共展示了OConstants.DATATYPE_PROPERTY属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSetDatatypeProperties

/**
 * This method returns the datatype properties set on this resource.
 *
 * @return
 */
public Set<DatatypeProperty> getSetDatatypeProperties() {
    Property[] properties = ontologyService.getDatatypeProperties(
            this.nodeId.toString());
    Set<DatatypeProperty> dataProps = new HashSet<DatatypeProperty>();
    for (int i = 0; i < properties.length; i++) {
        if (properties[i].getType() != OConstants.DATATYPE_PROPERTY) {
            throw new GateOntologyException("The property :"
                    + properties[i].getUri()
                    + " returned from the repository is not an DatatypeProperty");
        }
        String propUri = properties[i].getUri();
        OResource resource = null;
        resource = new DatatypePropertyImpl(ontology.createOURI(propUri),
                this.ontology, ontologyService);
        dataProps.add((DatatypeProperty) resource);
    }
    return dataProps;
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:23,代码来源:OInstanceImpl.java

示例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);
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:20,代码来源:OWLOntologyServiceImpl.java

示例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;
    }
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:16,代码来源:OWLOntologyServiceImpl.java

示例4: getSetDatatypeProperties

/**
 * This method returns the datatype properties set on this resource.
 * 
 * @return
 */
public Set<DatatypeProperty> getSetDatatypeProperties() {
    Property[] properties = ontologyService.getDatatypeProperties(
            this.nodeId.toString());
    Set<DatatypeProperty> dataProps = new HashSet<DatatypeProperty>();
    for(int i = 0; i < properties.length; i++) {
      if(properties[i].getType() != OConstants.DATATYPE_PROPERTY) {
        throw new GateOntologyException("The property :"
                + properties[i].getUri()
                + " returned from the repository is not an DatatypeProperty");
      }
      String propUri = properties[i].getUri();
      OResource resource = null;
      resource = new DatatypePropertyImpl(ontology.createOURI(propUri),
                this.ontology, ontologyService);
      dataProps.add((DatatypeProperty)resource);
    }
    return dataProps;
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:23,代码来源:OInstanceImpl.java

示例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);
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:21,代码来源:OntologyServiceImplSesame.java

示例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;
  }
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:16,代码来源:OntologyServiceImplSesame.java

示例7: loadDatatypeProperties

public void loadDatatypeProperties() {
    Set<OWLDataProperty> auris = new HashSet<OWLDataProperty>();
    for (OWLOntology o : ontologies) {
        auris.addAll(o.getDataPropertiesInSignature());
    }
    for (OWLDataProperty u : auris) {
        Property p = new Property(OConstants.DATATYPE_PROPERTY, u.getIRI()
                .toString());
        dataProperties.put(u, p);
    }
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:11,代码来源:OntologyParser.java

示例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;

    }

}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:48,代码来源:Utils.java


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