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


Java OConstants.OBJECT_PROPERTY属性代码示例

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


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

示例1: getSetObjectProperties

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

示例2: getInverseProperties

public Set<ObjectProperty> getInverseProperties() {
    Property[] properties = ontologyService.getInverseProperties(
            this.nodeId.toString());
    Set<ObjectProperty> set = new HashSet<ObjectProperty>();
    for (int i = 0; i < properties.length; i++) {
        byte type = properties[i].getType();
        if (type != OConstants.OBJECT_PROPERTY
                && type != OConstants.SYMMETRIC_PROPERTY
                && type != OConstants.TRANSITIVE_PROPERTY)
            throw new GateOntologyException(
                    "Invalid Property type returned as an inverse property");
        set.add((ObjectProperty) Utils.createOProperty(
                this.ontology, this.ontologyService, properties[i].getUri(), properties[i]
                .getType()));
    }
    return set;
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:17,代码来源:ObjectPropertyImpl.java

示例3: 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

示例4: 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

示例5: getSetObjectProperties

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

示例6: getInverseProperties

public Set<ObjectProperty> getInverseProperties() {
  Property[] properties = ontologyService.getInverseProperties(
          this.nodeId.toString());
  Set<ObjectProperty> set = new HashSet<ObjectProperty>();
  for(int i = 0; i < properties.length; i++) {
    byte type = properties[i].getType();
    if(type != OConstants.OBJECT_PROPERTY
            && type != OConstants.SYMMETRIC_PROPERTY
            && type != OConstants.TRANSITIVE_PROPERTY)
      throw new GateOntologyException(
              "Invalid Property type returned as an inverse property");
    set.add((ObjectProperty)Utils.createOProperty(
            this.ontology, this.ontologyService, properties[i].getUri(), properties[i]
                    .getType()));
  }
  return set;
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:17,代码来源:ObjectPropertyImpl.java

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

示例8: 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

示例9: 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

示例10: registerObjectProperty

/**
 * @param u
 */
private void registerObjectProperty(OWLObjectProperty u) {
    Property p = new Property(OConstants.OBJECT_PROPERTY, u.getIRI().toString());
    objectProperties.put(u, p);
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:7,代码来源:OntologyParser.java


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