本文整理汇总了Java中org.semanticweb.owlapi.model.OWLDataSomeValuesFrom类的典型用法代码示例。如果您正苦于以下问题:Java OWLDataSomeValuesFrom类的具体用法?Java OWLDataSomeValuesFrom怎么用?Java OWLDataSomeValuesFrom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLDataSomeValuesFrom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLDataSomeValuesFrom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
public void visit(SWRLDataRangeAtom atom) {
if (atom.getArgument() instanceof SWRLVariable)
throwVarError(atom);
// dr(literal) :-
// convert to: ClassAssertion(DataSomeValuesFrom(freshDP DataOneOf(literal)) freshIndividual)
// and top -> \forall freshDP.dr
OWLLiteral lit=((SWRLLiteralArgument)atom.getArgument()).getLiteral();
OWLDataRange dr=atom.getPredicate();
OWLNamedIndividual freshIndividual=getFreshIndividual();
OWLDataProperty freshDP=getFreshDataProperty();
OWLDataSomeValuesFrom some=m_factory.getOWLDataSomeValuesFrom(freshDP,m_factory.getOWLDataOneOf(lit));
OWLClassExpression definition=getDefinitionFor(some,m_alreadyExists);
if (!m_alreadyExists[0])
m_newInclusions.add(new OWLClassExpression[] { negative(definition),some });
addFact(m_factory.getOWLClassAssertionAxiom(definition,freshIndividual));
m_newInclusions.add(new OWLClassExpression[] { m_factory.getOWLDataAllValuesFrom(freshDP,dr) });
}
示例2: addToOntology
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataSomeValuesFromProperty_RL", pm);
OWLDatatype datatype = OWL2Datatype.XSD_DATE_TIME.getDatatype(factory);
OWLClass range = featurePool.getExclusiveClass(":DataSomeValuesFrom_RL");
OWLDataSomeValuesFrom restriction = factory.getOWLDataSomeValuesFrom(property, datatype);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(restriction, range));
}
示例3: addToOntology
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataSomeValuesFromProperty", pm);
OWLDatatype datatype = OWL2Datatype.XSD_DATE_TIME.getDatatype(factory);
OWLClass someValuesFrom = featurePool.getExclusiveClass(":DataSomeValuesFrom");
OWLDataSomeValuesFrom restriction = factory.getOWLDataSomeValuesFrom(property, datatype);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(someValuesFrom, restriction));
}
示例4: getClass2DataProperty2LiteralAxioms
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
/**
* create axioms for class--dataproperty----literal relation.
*
* @param src
* @param dataprop
* @param dest
* @return
*/
private void getClass2DataProperty2LiteralAxioms(OWLClass src, OWLDataProperty dataprop, OWLLiteral dest) {
// Set<OWLAxiom> tmpaxioms = new HashSet<OWLAxiom>();
OWLAxiom axiom;
OWLDataSomeValuesFrom owlDataSomeValuesFrom;
OWLDataHasValue owlLDataHasValue;
OWLDataMaxCardinality owlDataMaxCardinality;
OWLDataOneOf owldataOneOf;
// set domain and range
// scoped domain
if (editor.isGenerateDomainAxiom()) {
owlLDataHasValue = owlDataFactory.getOWLDataHasValue(dataprop, dest);
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlLDataHasValue, src);
domainAndRangeAxioms.add(axiom);
owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, owlDataFactory.getTopDatatype());
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataSomeValuesFrom, src);
domainAndRangeAxioms.add(axiom);
}
if (editor.isGenerateCardinalityAxiom()) {
owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop,
owlDataFactory.getTopDatatype());
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataMaxCardinality);
cardinalityAxioms.add(axiom);
// need to verify with Adila
owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop,
owlDataFactory.getTopDatatype());
axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataMaxCardinality);
cardinalityAxioms.add(axiom);
}
// return tmpaxioms;
}
示例5: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
public void visit(OWLDataSomeValuesFrom arg0) {
try {
final OWLDatatype dt = Utils.ensureDatatype(arg0.getFiller());
final OWLDataProperty dp = Utils.ensureDataProperty(arg0
.getProperty());
integrityConstraints.add(integrityConstraintFactory
.MinDataParticipationConstraint(subjClass, dp, dt, 1));
} catch (UnsupportedICException e) {
notSupported(arg0);
}
}
示例6: axiomatizeTopDataProperty
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
protected void axiomatizeTopDataProperty(OWLAxioms axioms) {
OWLDatatype anonymousConstantsDatatype=m_factory.getOWLDatatype(IRI.create("internal:anonymous-constants"));
OWLLiteral newConstant=m_factory.getOWLLiteral("internal:constant",anonymousConstantsDatatype);
OWLDataOneOf oneOfNewConstant=m_factory.getOWLDataOneOf(newConstant);
OWLDataSomeValuesFrom hasTopNewConstant=m_factory.getOWLDataSomeValuesFrom(m_topDataProperty,oneOfNewConstant);
axioms.m_conceptInclusions.add(new OWLClassExpression[] { hasTopNewConstant });
}
示例7: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
public OWLClassExpression visit(OWLDataSomeValuesFrom d) {
OWLDataRange filler=getSimplified(d.getFiller());
if (isBottomDataRange(filler))
return m_factory.getOWLNothing();
else
return m_factory.getOWLDataSomeValuesFrom(d.getProperty(),filler);
}
示例8: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
public void visit(OWLDataSomeValuesFrom object) {
if (!object.getProperty().isOWLBottomDataProperty()) {
AtomicRole atomicRole=getAtomicRole(object.getProperty());
LiteralDataRange literalRange=m_dataRangeConverter.convertDataRange(object.getFiller());
AtLeastDataRange atLeastDataRange=AtLeastDataRange.create(1,atomicRole,literalRange);
if (!atLeastDataRange.isAlwaysFalse())
m_headAtoms.add(Atom.create(atLeastDataRange,X));
}
}
示例9: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
public Boolean visit(OWLDisjointDataPropertiesAxiom axiom) {
int n=axiom.getProperties().size();
OWLDataPropertyExpression[] props=axiom.getProperties().toArray(new OWLDataPropertyExpression[n]);
for (int i=0;i<n-1;i++) {
for (int j=i+1;j<n;j++) {
OWLDataSomeValuesFrom some_i=factory.getOWLDataSomeValuesFrom(props[i],factory.getOWLDatatype(IRI.create(InternalDatatype.RDFS_LITERAL.getIRI())));
OWLDataSomeValuesFrom some_j=factory.getOWLDataSomeValuesFrom(props[j],factory.getOWLDatatype(IRI.create(InternalDatatype.RDFS_LITERAL.getIRI())));
OWLDataMaxCardinality max1=factory.getOWLDataMaxCardinality(1,factory.getOWLDataProperty(IRI.create(AtomicRole.TOP_DATA_ROLE.getIRI())));
OWLClassExpression desc=factory.getOWLObjectIntersectionOf(some_i,some_j,max1);
if (reasoner.isSatisfiable(desc))
return Boolean.FALSE;
}
}
return Boolean.TRUE;
}
示例10: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
@Override
public OWLDataSomeValuesFrom visit(ElkDataSomeValuesFrom expression) {
List<? extends ElkDataPropertyExpression> propertyExpressions = expression
.getDataPropertyExpressions();
if (propertyExpressions.size() > 0) {
throw new IllegalArgumentException(
"OWLAPI supports only one data property in OWLDataSomeValuesFrom");
}
return owlFactory_.getOWLDataSomeValuesFrom(
convert(propertyExpressions.get(0)),
convert(expression.getDataRange()));
}
示例11: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
@Override
public OWLClassExpression visit(OWLDataSomeValuesFrom ce) {
OWLDataRange filler = ce.getFiller().accept(this);
if (negated) {
return dataFactory
.getOWLDataAllValuesFrom(ce.getProperty(), filler);
} else {
return dataFactory.getOWLDataSomeValuesFrom(ce.getProperty(),
filler);
}
}
示例12: equals
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
return obj instanceof OWLDataSomeValuesFrom;
}
示例13: getClass2DataProperty2DataTypeAxioms
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
/**
* create axioms for class--dataproperty----datatype relation.
*/
// be sure for OWLDatatype vs OWL2DataType
private void getClass2DataProperty2DataTypeAxioms(OWLClass src, OWLDataProperty dataprop, OWLDatatype dest) {
// Set<OWLAxiom> tmpaxioms = new HashSet<OWLAxiom>();
OWLAxiom axiom;
OWLDataSomeValuesFrom owlDataSomeValuesFrom;
OWLDataAllValuesFrom owlDataAllValuesFrom;
OWLDataMaxCardinality owlDataMaxCardinality;
// set domain and range
// scoped domain
if (editor.isGenerateDomainAxiom()) {
owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, dest);
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataSomeValuesFrom, src);
domainAndRangeAxioms.add(axiom);
owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, owlDataFactory.getTopDatatype());
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataSomeValuesFrom, src);
domainAndRangeAxioms.add(axiom);
}
// scoped range
if (editor.isGenerateRangeAxiom()) {
owlDataAllValuesFrom = owlDataFactory.getOWLDataAllValuesFrom(dataprop, dest);
axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataAllValuesFrom);
domainAndRangeAxioms.add(axiom);
owlDataAllValuesFrom = owlDataFactory.getOWLDataAllValuesFrom(dataprop, dest);
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataAllValuesFrom);
domainAndRangeAxioms.add(axiom);
}
// set existential restriction
// source existential functionality
if (editor.isGenerateExistentialAxiom()) {
owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, dest);
axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataSomeValuesFrom);
existentialAxioms.add(axiom);
}
// destination existential functionality. dataproperty doesn't have
// inverse property
// set cardinality restriction
if (editor.isGenerateCardinalityAxiom()) {
owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, dest);
axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataMaxCardinality);
cardinalityAxioms.add(axiom);
owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, dest);
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataMaxCardinality);
cardinalityAxioms.add(axiom);
owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop,
owlDataFactory.getTopDatatype());
axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataMaxCardinality);
cardinalityAxioms.add(axiom);
owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop,
owlDataFactory.getTopDatatype());
axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataMaxCardinality);
cardinalityAxioms.add(axiom);
}
// dataproperty doesn't have inverse property
// System.out.println(axiom.toString());
// return tmpaxioms;
}
示例14: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
public void visit(OWLDataSomeValuesFrom object) {
visitProperty(object.getProperty());
}
示例15: visit
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; //导入依赖的package包/类
public void visit(OWLDataSomeValuesFrom object) {
m_hasDatatypes=true;
}