本文整理汇总了Java中org.semanticweb.owlapi.model.OWLDatatype类的典型用法代码示例。如果您正苦于以下问题:Java OWLDatatype类的具体用法?Java OWLDatatype怎么用?Java OWLDatatype使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLDatatype类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLDatatype类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
public void visit(SWRLDataRangeAtom at) {
OWLDataRange dr=at.getPredicate();
SWRLDArgument argument=at.getArgument();
if (!(argument instanceof SWRLVariable))
throw new IllegalArgumentException("A SWRL rule contains a data range with an argument that is not a literal, and such rules are not supported.");
if (!m_isPositive)
dr=m_factory.getOWLDataComplementOf(dr);
dr=m_expressionManager.getNNF(m_expressionManager.getSimplified(dr));
if (dr instanceof OWLDataIntersectionOf || dr instanceof OWLDataUnionOf) {
OWLDatatype definition=getDefinitionFor(dr,m_alreadyExists);
if (!m_alreadyExists[0])
m_dataRangeInclusions.add(new OWLDataRange[] { negative(definition),dr });
dr=definition;
}
SWRLAtom atom=m_factory.getSWRLDataRangeAtom(dr,argument);
m_normalizedHeadAtoms.add(atom);
m_headDataRangeVariables.add((SWRLVariable)argument);
}
示例2: visit
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
public Object visit(OWLDatatype object) {
String datatypeURI=object.getIRI().toString();
if (InternalDatatype.RDFS_LITERAL.getIRI().equals(datatypeURI))
return InternalDatatype.RDFS_LITERAL;
if (datatypeURI.startsWith("internal:defdata#") || m_definedDatatypeIRIs.contains(object.getIRI().toString()))
return InternalDatatype.create(datatypeURI);
DatatypeRestriction datatype=DatatypeRestriction.create(datatypeURI,DatatypeRestriction.NO_FACET_URIs,DatatypeRestriction.NO_FACET_VALUES);
if (datatypeURI.startsWith("internal:unknown-datatype#"))
m_allUnknownDatatypeRestrictions.add(datatype);
else {
try {
DatatypeRegistry.validateDatatypeRestriction(datatype);
}
catch (UnsupportedDatatypeException e) {
if (m_ignoreUnsupportedDatatypes) {
if (m_warningMonitor!=null)
m_warningMonitor.warning("Ignoring unsupported datatype '"+object.getIRI().toString()+"'.");
m_allUnknownDatatypeRestrictions.add(datatype);
}
else
throw e;
}
}
return datatype;
}
示例3: visit
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
public Boolean visit(OWLDatatypeDefinitionAxiom axiom) {
reasoner.throwInconsistentOntologyExceptionIfNecessary();
if (!reasoner.isConsistent())
return true;
if (reasoner.m_dlOntology.hasDatatypes()) {
OWLDataFactory factory=reasoner.getDataFactory();
OWLIndividual freshIndividual=factory.getOWLAnonymousIndividual("fresh-individual");
OWLDataProperty freshDataProperty=factory.getOWLDataProperty(IRI.create("fresh-data-property"));
OWLDataRange dataRange=axiom.getDataRange();
OWLDatatype dt=axiom.getDatatype();
OWLDataIntersectionOf dr1=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dataRange),dt);
OWLDataIntersectionOf dr2=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dt),dataRange);
OWLDataUnionOf union=factory.getOWLDataUnionOf(dr1,dr2);
OWLClassExpression c=factory.getOWLDataSomeValuesFrom(freshDataProperty,union);
OWLClassAssertionAxiom ax=factory.getOWLClassAssertionAxiom(c,freshIndividual);
Tableau tableau=reasoner.getTableau(ax);
return !tableau.isSatisfiable(true,true,null,null,null,null,null,ReasoningTaskDescription.isAxiomEntailed(axiom));
}
else
return false;
}
示例4: OWLLiteralImpl
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
/**
* @param literal the lexical form
* @param lang the language; can be null or an empty string, in which case datatype can be any
* datatype but not null
* @param datatype the datatype; if lang is null or the empty string, it can be null or it MUST
* be RDFPlainLiteral
*/
public OWLLiteralImpl(@Nonnull String literal, @Nullable String lang,
@Nullable OWLDatatype datatype) {
this.literal = new LiteralWrapper(checkNotNull(literal, "literal cannot be null"));
if (lang == null || lang.isEmpty()) {
language = "";
if (datatype == null) {
this.datatype = RDF_PLAIN_LITERAL;
} else {
this.datatype = datatype;
}
} else {
if (datatype != null && !datatype.isRDFPlainLiteral()) {
// ERROR: attempting to build a literal with a language tag and
// type different from plain literal
throw new OWLRuntimeException("Error: cannot build a literal with type: "
+ datatype.getIRI() + " and language: " + lang);
}
language = lang;
this.datatype = RDF_PLAIN_LITERAL;
}
hashcode = getHashCode(literal);
}
示例5: checkInconsistentProperty
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
private void checkInconsistentProperty(OWLDataProperty dp, OWLDatatype type) {
for (OWLDataPropertyRangeAxiom a : dprAxioms) {
OWLDataPropertyExpression pe = a.getProperty();
OWLDataRange r = a.getRange();
// TODO: check DataOneOf
// TODO: check OWLDataIntersectionOf
OWLDatatype otype = r.asOWLDatatype();
if (!pe.isAnonymous()) {
if (!otype.equals(type)) {
problems.add("The literal value restriction " + dp + " is inconsistent with the data property " +
"range axiom " + a);
}
} else {
problems.add("Found anonymous data property expression in data property range axiom: " + pe);
}
}
}
示例6: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLClass domain = featurePool.getExclusiveClass(":DatatypeMapsDomain");
OWLDatatype range = factory.getOWLDatatype(datatype);
String namespace = datatype.getPrefixedName().split(":")[0];
String name = datatype.getShortForm();
String propertyIri = ":" + namespace + WordUtils.capitalize(name) + "Property";
OWLDataProperty property = factory.getOWLDataProperty(propertyIri, pm);
addProperty(domain, property, range);
}
示例7: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataExactQualifiedCardinality", pm);
OWLDatatype datatype = OWL2Datatype.XSD_STRING.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLDatatype affectedDatatype = OWL2Datatype.XSD_DATE_TIME.getDatatype(factory);
OWLDataExactCardinality cardinality = factory.getOWLDataExactCardinality(12, property, affectedDatatype);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(featurePool.getExclusiveClass(":DataExactQualifiedCardinalityRange"), cardinality));
}
示例8: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataMaxQualifiedCardinality_RL", pm);
OWLDatatype datatype = OWL2Datatype.RDFS_LITERAL.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLDatatype affectedDatatype = OWL2Datatype.XSD_BYTE.getDatatype(factory);
OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(1, property, affectedDatatype);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(featurePool.getExclusiveClass(":DataMaxQualifiedCardinalityRange_RL"), cardinality));
}
示例9: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataMinCardinality", pm);
OWLDatatype datatype = OWL2Datatype.XSD_BOOLEAN.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLClass range = featurePool.getExclusiveClass(":DataMinCardinalityRange");
OWLDataMinCardinality cardinality = factory.getOWLDataMinCardinality(3, property);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality));
}
示例10: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataMinQualifiedCardinality", pm);
OWLDatatype datatype = OWL2Datatype.XSD_FLOAT.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLDatatype affectedDatatype = OWL2Datatype.XSD_DATE_TIME.getDatatype(factory);
OWLDataMinCardinality cardinality = factory.getOWLDataMinCardinality(9, property, affectedDatatype);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(featurePool.getExclusiveClass(":DataMinQualifiedCardinalityRange"), cardinality));
}
示例11: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataMaxCardinality_RL", pm);
OWLDatatype datatype = OWL2Datatype.XSD_FLOAT.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLClass range = featurePool.getExclusiveClass(":DataMaxCardinalityRange_RL");
OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(1, property);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality));
}
示例12: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataMaxQualifiedCardinality", pm);
OWLDatatype datatype = OWL2Datatype.RDFS_LITERAL.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLDatatype affectedDatatype = OWL2Datatype.XSD_BYTE.getDatatype(factory);
OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(18, property, affectedDatatype);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(featurePool.getExclusiveClass(":DataMaxQualifiedCardinalityRange"), cardinality));
}
示例13: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataMaxCardinality", pm);
OWLDatatype datatype = OWL2Datatype.XSD_FLOAT.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLClass range = featurePool.getExclusiveClass(":DataMaxCardinalityRange");
OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(19, property);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality));
}
示例14: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDataProperty property = factory.getOWLDataProperty(":dataExactCardinality", pm);
OWLDatatype datatype = OWL2Datatype.XSD_STRING.getDatatype(factory);
addToGenericDomainAndNewRange(property, datatype);
OWLClass range = featurePool.getExclusiveClass(":DataExactCardinalityRange");
OWLDataExactCardinality cardinality = factory.getOWLDataExactCardinality(11, property);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality));
}
示例15: addToOntology
import org.semanticweb.owlapi.model.OWLDatatype; //导入依赖的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));
}