本文整理汇总了Java中com.hp.hpl.jena.ontology.OntClass.setSuperClass方法的典型用法代码示例。如果您正苦于以下问题:Java OntClass.setSuperClass方法的具体用法?Java OntClass.setSuperClass怎么用?Java OntClass.setSuperClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.ontology.OntClass
的用法示例。
在下文中一共展示了OntClass.setSuperClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateEntity
import com.hp.hpl.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass generateEntity(String entityString) {
// create the entity subclass
String entityLabel = this.getFragment(entityString);
String entityNamespace = this.getNamespace(entityString);
if (entityNamespace == null) {
log.warn("Namespace is null for: " + entityString);
return null;
}
String partialUri = String.format("%8s", classId++).replace(' ', '0');
String uri = entityNamespace + partialUri;
log.debug("Generating ENTITY: " + uri);
OntClass entitySubclass = m.createClass(uri);
entitySubclass.addProperty(rdfsLabel, entityLabel);
entitySubclass.setSuperClass(entityClass);
// save for later
allConcepts.put(entitySubclass.getLabel(null), entitySubclass);
return entitySubclass;
}
示例2: generateCharacteristic
import com.hp.hpl.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass generateCharacteristic(String characteristicString) {
// create the entity subclass
String characteristicLabel = this.getFragment(characteristicString);
String characteristicNamespace = this.getNamespace(characteristicString);
if (characteristicNamespace == null) {
log.warn("Namespace is null for: " + characteristicString);
return null;
}
String partialUri = String.format("%8s", classId++).replace(' ', '0');
String uri = characteristicNamespace + partialUri;
log.debug("Generating CHARACTERISTIC: " + uri);
OntClass characteristicSubclass = m.createClass(uri);
characteristicSubclass.addProperty(rdfsLabel, characteristicLabel);
characteristicSubclass.setSuperClass(characteristicClass);
// save for later
allConcepts.put(characteristicSubclass.getLabel(null), characteristicSubclass);
return characteristicSubclass;
}