本文整理汇总了Java中org.apache.jena.ontology.OntClass.removeAll方法的典型用法代码示例。如果您正苦于以下问题:Java OntClass.removeAll方法的具体用法?Java OntClass.removeAll怎么用?Java OntClass.removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.ontology.OntClass
的用法示例。
在下文中一共展示了OntClass.removeAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCardinalityRestriction
import org.apache.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass createCardinalityRestriction(OntProperty p,
int cardinality) {
/*
* NOTE: the create(Min|Max)CardinalityRestriction(...) methods from
* Jena - or the turtle serialization - encodes the cardinality as an
* xsd:int, which should be an xsd:nonNegativeInteger according to
* https://www.w3.org/TR/owl2-mapping-to-rdf/
*
* That's why we create and set the typed literal that represents the
* cardinality ourselves.
*/
OntClass restriction = this.ontmodel.createCardinalityRestriction(null,
p, cardinality);
restriction.removeAll(OWL.cardinality);
Literal cardAsNonNegativeInteger = ontmodel.createTypedLiteral(
cardinality,
"http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
restriction.addLiteral(OWL.cardinality, cardAsNonNegativeInteger);
return restriction;
}
示例2: createMinCardinalityRestriction
import org.apache.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass createMinCardinalityRestriction(OntProperty p,
int cardinality) {
/*
* NOTE: the create(Min|Max)CardinalityRestriction(...) methods from
* Jena - or the turtle serialization - encodes the cardinality as an
* xsd:int, which should be an xsd:nonNegativeInteger according to
* https://www.w3.org/TR/owl2-mapping-to-rdf/
*
* That's why we create and set the typed literal that represents the
* cardinality ourselves.
*/
OntClass restriction = this.ontmodel
.createMinCardinalityRestriction(null, p, cardinality);
restriction.removeAll(OWL.minCardinality);
Literal cardAsNonNegativeInteger = ontmodel.createTypedLiteral(
cardinality,
"http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
restriction.addLiteral(OWL.minCardinality, cardAsNonNegativeInteger);
return restriction;
}
示例3: createMaxCardinalityRestriction
import org.apache.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass createMaxCardinalityRestriction(OntProperty p,
int cardinality) {
/*
* NOTE: the create(Min|Max)CardinalityRestriction(...) methods from
* Jena - or the turtle serialization - encodes the cardinality as an
* xsd:int, which should be an xsd:nonNegativeInteger according to
* https://www.w3.org/TR/owl2-mapping-to-rdf/
*
* That's why we create and set the typed literal that represents the
* cardinality ourselves.
*/
OntClass restriction = this.ontmodel
.createMaxCardinalityRestriction(null, p, cardinality);
restriction.removeAll(OWL.maxCardinality);
Literal cardAsNonNegativeInteger = ontmodel.createTypedLiteral(
cardinality,
"http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
restriction.addLiteral(OWL.maxCardinality, cardAsNonNegativeInteger);
return restriction;
}
示例4: createQCardinalityRestriction
import org.apache.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass createQCardinalityRestriction(OntProperty p,
int cardinality, Resource range) {
/*
* NOTE: We cannot use the create(Min|Max)CardinalityQRestriction(...)
* methods from the Jena API, because they throw the following
* exception: org.apache.jena.ontology.ProfileException: Attempted to
* use language construct CARDINALITY_Q that is not supported in the
* current language profile: OWL Full
*
* So, we use a workaround to create the qualified cardinality
* restriction. For further details, see
* http://stackoverflow.com/questions/20562107/how-to-add-qualified-
* cardinality-in-jena
*/
OntClass restriction = this.ontmodel.createCardinalityRestriction(null,
p, cardinality);
restriction.removeAll(OWL.cardinality);
Literal cardAsNonNegativeInteger = ontmodel.createTypedLiteral(
cardinality,
"http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
restriction.addLiteral(OWL2.qualifiedCardinality,
cardAsNonNegativeInteger);
restriction.addProperty(OWL2.onClass, range);
return restriction;
}
示例5: createQMinCardinalityRestriction
import org.apache.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass createQMinCardinalityRestriction(OntProperty p,
int cardinality, Resource range) {
/*
* NOTE: We cannot use the create(Min|Max)CardinalityQRestriction(...)
* methods from the Jena API, because they throw the following
* exception: org.apache.jena.ontology.ProfileException: Attempted to
* use language construct CARDINALITY_Q that is not supported in the
* current language profile: OWL Full
*
* So, we use a workaround to create the qualified cardinality
* restriction. For further details, see
* http://stackoverflow.com/questions/20562107/how-to-add-qualified-
* cardinality-in-jena
*/
OntClass restriction = this.ontmodel
.createMinCardinalityRestriction(null, p, cardinality);
restriction.removeAll(OWL.minCardinality);
Literal cardAsNonNegativeInteger = ontmodel.createTypedLiteral(
cardinality,
"http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
restriction.addLiteral(OWL2.minQualifiedCardinality,
cardAsNonNegativeInteger);
restriction.addProperty(OWL2.onClass, range);
return restriction;
}
示例6: createQMaxCardinalityRestriction
import org.apache.jena.ontology.OntClass; //导入方法依赖的package包/类
public OntClass createQMaxCardinalityRestriction(OntProperty p,
int cardinality, Resource range) {
/*
* NOTE: We cannot use the create(Min|Max)CardinalityQRestriction(...)
* methods from the Jena API, because they throw the following
* exception: org.apache.jena.ontology.ProfileException: Attempted to
* use language construct CARDINALITY_Q that is not supported in the
* current language profile: OWL Full
*
* So, we use a workaround to create the qualified cardinality
* restriction. For further details, see
* http://stackoverflow.com/questions/20562107/how-to-add-qualified-
* cardinality-in-jena
*/
OntClass restriction = this.ontmodel
.createMaxCardinalityRestriction(null, p, cardinality);
restriction.removeAll(OWL.maxCardinality);
Literal cardAsNonNegativeInteger = ontmodel.createTypedLiteral(
cardinality,
"http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
restriction.addLiteral(OWL2.maxQualifiedCardinality,
cardAsNonNegativeInteger);
restriction.addProperty(OWL2.onClass, range);
return restriction;
}