本文整理汇总了Java中org.semanticweb.owlapi.vocab.OWLFacet类的典型用法代码示例。如果您正苦于以下问题:Java OWLFacet类的具体用法?Java OWLFacet怎么用?Java OWLFacet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OWLFacet类属于org.semanticweb.owlapi.vocab包,在下文中一共展示了OWLFacet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testShouldSerializeOWLDatatypeRestrictionImpl
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
public void testShouldSerializeOWLDatatypeRestrictionImpl() {
delayTestFinish(TEST_DELAY_MS);
OWLDataFactory df = new OWLDataFactoryImpl();
OWLDatatype datatype = df.getOWLDatatype(IRI.create("http://org.semanticweb.owlapi.gwt#A"));
Set<OWLFacetRestriction> facetRestrictions = new HashSet<OWLFacetRestriction>();
facetRestrictions.add(df.getOWLFacetRestriction(OWLFacet.MIN_LENGTH, df.getOWLLiteral("3")));
facetRestrictions.add(df.getOWLFacetRestriction(OWLFacet.MAX_LENGTH, df.getOWLLiteral("4")));
final OWLDatatypeRestrictionImpl in = new OWLDatatypeRestrictionImpl(datatype, facetRestrictions);
OWLObjectSerializationTestsServiceAsync service = GWT.create(OWLObjectSerializationTestsService.class);
service.testOWLDatatypeRestrictionImpl(in, new AsyncCallback<OWLDatatypeRestrictionImpl>() {
@Override
public void onFailure(Throwable throwable) {
throwable.printStackTrace();
fail(throwable.getMessage());
}
@Override
public void onSuccess(OWLDatatypeRestrictionImpl out) {
assertEquals(in, out);
finishTest();
}
});
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:24,代码来源:GwtTest_OWLObject_Serialization.java
示例2: testShouldSerializeOWLFacetRestrictionImpl
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
public void testShouldSerializeOWLFacetRestrictionImpl() {
delayTestFinish(TEST_DELAY_MS);
final OWLFacetRestrictionImpl in = new OWLFacetRestrictionImpl(OWLFacet.LENGTH, new OWLLiteralImplInteger(33, new OWL2DatatypeImpl(OWL2Datatype.XSD_INTEGER)));
OWLObjectSerializationTestsServiceAsync service = GWT.create(OWLObjectSerializationTestsService.class);
service.testOWLFacetRestrictionImpl(in, new AsyncCallback<OWLFacetRestrictionImpl>() {
@Override
public void onFailure(Throwable throwable) {
fail(throwable.getMessage());
}
@Override
public void onSuccess(OWLFacetRestrictionImpl out) {
assertEquals(in, out);
finishTest();
}
});
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:19,代码来源:GwtTest_OWLObject_Serialization.java
示例3: addToOntology
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLDatatype datatype = factory.getOWLDatatype(":DatatypeRestrictionDatatype", pm);
OWLFacetRestriction fr1 = factory.getOWLFacetRestriction(OWLFacet.MIN_LENGTH, 10);
OWLLiteral patternLiteral = factory.getOWLLiteral("DatatypeRestrictionLiteral");
OWLFacetRestriction fr2 = factory.getOWLFacetRestriction(OWLFacet.PATTERN, patternLiteral);
OWLDatatypeRestriction restriction = factory.getOWLDatatypeRestriction(datatype, fr1, fr2);
OWLDataProperty property = factory.getOWLDataProperty(":datatypeRestrictionProperty", pm);
addToGenericDomainAndNewRange(property, restriction);
}
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:14,代码来源:OwlDatatypeRestrictionFeature.java
示例4: getOWLDatatypeRestriction
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Nonnull
@Override
public OWLDatatypeRestriction getOWLDatatypeRestriction(
OWLDatatype dataType, OWLFacet facet, OWLLiteral typedLiteral) {
checkNotNull(dataType, "datatype cannot be null");
checkNotNull(facet, "facet cannot be null");
checkNotNull(typedLiteral, "typedConstant cannot be null");
return new OWLDatatypeRestrictionImpl(dataType,
CollectionFactory.createSet(getOWLFacetRestriction(facet,
typedLiteral)));
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:12,代码来源:OWLDataFactoryImpl.java
示例5: getOWLDatatypeMinMaxInclusiveRestriction
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
public OWLDatatypeRestriction getOWLDatatypeMinMaxInclusiveRestriction(
int minInclusive, int maxInclusive) {
return getOWLDatatypeRestriction(
getIntegerOWLDatatype(),
getOWLFacetRestriction(OWLFacet.MIN_INCLUSIVE,
getOWLLiteral(minInclusive)),
getOWLFacetRestriction(OWLFacet.MAX_INCLUSIVE, maxInclusive));
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:10,代码来源:OWLDataFactoryImpl.java
示例6: getOWLDatatypeMinMaxExclusiveRestriction
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
public OWLDatatypeRestriction getOWLDatatypeMinMaxExclusiveRestriction(
int minExclusive, int maxExclusive) {
return getOWLDatatypeRestriction(
getIntegerOWLDatatype(),
getOWLFacetRestriction(OWLFacet.MIN_EXCLUSIVE,
getOWLLiteral(minExclusive)),
getOWLFacetRestriction(OWLFacet.MAX_EXCLUSIVE, maxExclusive));
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:10,代码来源:OWLDataFactoryImpl.java
示例7: getOWLFacetRestriction
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Nonnull
@Override
public OWLFacetRestriction getOWLFacetRestriction(OWLFacet facet,
OWLLiteral facetValue) {
checkNotNull(facet, "facet cannot be null");
checkNotNull(facetValue, "facetValue cannot be null");
return new OWLFacetRestrictionImpl(facet, facetValue);
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:9,代码来源:OWLDataFactoryImpl.java
示例8: readObject
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
protected OWLFacetRestriction readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException {
int facetIndex = inputStream.readInt();
OWLFacet facet = getFacet(facetIndex);
OWLLiteral literal = inputStream.readOWLObject();
return inputStream.getDataFactory().getOWLFacetRestriction(facet, literal);
}
开发者ID:matthewhorridge,项目名称:binaryowl,代码行数:8,代码来源:OWLFacetRestrictionSerializer.java
示例9: getFacetMarker
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
/**
* Gets the facet marker for a given facet.
* @param facet The facet. Not {@code null}.
* @return The marker for the facet.
*/
public static int getFacetMarker(OWLFacet facet) {
switch (facet) {
case LENGTH:
return 0;
case MIN_LENGTH:
return 1;
case MAX_LENGTH:
return 2;
case PATTERN:
return 3;
case MIN_INCLUSIVE:
return 4;
case MIN_EXCLUSIVE:
return 5;
case MAX_INCLUSIVE:
return 6;
case MAX_EXCLUSIVE:
return 7;
case TOTAL_DIGITS:
return 8;
case FRACTION_DIGITS:
return 9;
case LANG_RANGE:
return 10;
default:
throw new RuntimeException("Illegal state. Case not covered");
}
}
开发者ID:matthewhorridge,项目名称:binaryowl,代码行数:34,代码来源:OWLFacetRestrictionSerializer.java
示例10: getFacet
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
/**
* Gets the {@link OWLFacet} for the specified facet marker index.
* @param facetMarker The facet marker index (>= 0, <= 10).
* @return The corresponding {@link OWLFacet}.
* @throws IndexOutOfBoundsException if the facet marker is out of the specified range.
*/
public static OWLFacet getFacet(int facetMarker) {
if(facetMarker < 0 || facetMarker > 10) {
throw new IndexOutOfBoundsException("Facet marker out of range");
}
switch (facetMarker) {
case 0:
return OWLFacet.LENGTH;
case 1:
return OWLFacet.MIN_LENGTH;
case 2:
return OWLFacet.MAX_LENGTH;
case 3:
return OWLFacet.PATTERN;
case 4:
return OWLFacet.MIN_INCLUSIVE;
case 5:
return OWLFacet.MIN_EXCLUSIVE;
case 6:
return OWLFacet.MAX_INCLUSIVE;
case 7:
return OWLFacet.MAX_EXCLUSIVE;
case 8:
return OWLFacet.TOTAL_DIGITS;
case 9:
return OWLFacet.FRACTION_DIGITS;
case 10:
return OWLFacet.LANG_RANGE;
default:
throw new IllegalArgumentException("Facet marker out of range");
}
}
开发者ID:matthewhorridge,项目名称:binaryowl,代码行数:38,代码来源:OWLFacetRestrictionSerializer.java
示例11: ensureFacetRestrictionTypeMarkersMatchSpec
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Test
public void ensureFacetRestrictionTypeMarkersMatchSpec() {
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.LENGTH), is(0));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.MIN_LENGTH), is(1));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.MAX_LENGTH), is(2));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.PATTERN), is(3));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.MIN_INCLUSIVE), is(4));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.MIN_EXCLUSIVE), is(5));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.MAX_INCLUSIVE), is(6));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.MAX_EXCLUSIVE), is(7));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.TOTAL_DIGITS), is(8));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.FRACTION_DIGITS), is(9));
assertThat(OWLFacetRestrictionSerializer.getFacetMarker(OWLFacet.LANG_RANGE), is(10));
assertThat(OWLFacetRestrictionSerializer.getFacet(0), is(OWLFacet.LENGTH));
assertThat(OWLFacetRestrictionSerializer.getFacet(1), is(OWLFacet.MIN_LENGTH));
assertThat(OWLFacetRestrictionSerializer.getFacet(2), is(OWLFacet.MAX_LENGTH));
assertThat(OWLFacetRestrictionSerializer.getFacet(3), is(OWLFacet.PATTERN));
assertThat(OWLFacetRestrictionSerializer.getFacet(4), is(OWLFacet.MIN_INCLUSIVE));
assertThat(OWLFacetRestrictionSerializer.getFacet(5), is(OWLFacet.MIN_EXCLUSIVE));
assertThat(OWLFacetRestrictionSerializer.getFacet(6), is(OWLFacet.MAX_INCLUSIVE));
assertThat(OWLFacetRestrictionSerializer.getFacet(7), is(OWLFacet.MAX_EXCLUSIVE));
assertThat(OWLFacetRestrictionSerializer.getFacet(8), is(OWLFacet.TOTAL_DIGITS));
assertThat(OWLFacetRestrictionSerializer.getFacet(9), is(OWLFacet.FRACTION_DIGITS));
assertThat(OWLFacetRestrictionSerializer.getFacet(10), is(OWLFacet.LANG_RANGE));
}
开发者ID:matthewhorridge,项目名称:binaryowl,代码行数:28,代码来源:FacetRestrictionTypeMarkerTestCase.java
示例12: _DatatypeRestriction
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Test
public void _DatatypeRestriction() {
OWLFacetRestriction f0 = FacetRestriction(OWLFacet.MIN_EXCLUSIVE, LIT);
OWLFacetRestriction f1 = FacetRestriction(OWLFacet.MAX_EXCLUSIVE, LIT);
OWLDatatypeRestriction obj = DatatypeRestriction(DT, f0, f1);
roundTrip(obj);
}
开发者ID:matthewhorridge,项目名称:binaryowl,代码行数:8,代码来源:ObjectRoundTripTestCase.java
示例13: testFailOnDataRange
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Test(expected = UnsupportedICException.class)
public void testFailOnDataRange() throws Exception {
Utils.ensureDatatype(
f.getOWLDatatypeRestriction(f.getIntegerOWLDatatype(),
f.getOWLFacetRestriction(OWLFacet.MAX_LENGTH, 10)));
}
开发者ID:kbss-cvut,项目名称:jopa,代码行数:7,代码来源:UtilsTest.java
示例14: visit
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
public OWLFacetRestriction visit(ElkFacetRestriction restriction) {
return owlFactory_.getOWLFacetRestriction(
OWLFacet.getFacet(convert(restriction.getConstrainingFacet())),
convert(restriction.getRestrictionValue()));
}
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:7,代码来源:AbstractElkObjectConverter.java
示例15: visit
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
public void visit(OWLDatatypeRestriction node) {
String subject = variables.peek();
for (Iterator<OWLFacetRestriction> iterator = node.getFacetRestrictions().iterator(); iterator.hasNext();) {
OWLFacetRestriction fr = iterator.next();
OWLFacet facet = fr.getFacet();
OWLLiteral value = fr.getFacetValue();
String valueString = value.getLiteral();
switch(facet) {
case LENGTH: sparql += String.format("STRLEN(STR(%s) = %d)", subject, value.parseInteger());
break;
case MIN_LENGTH: sparql += String.format("STRLEN(STR(%s) >= %d)", subject, value.parseInteger());
break;
case MAX_LENGTH: sparql += String.format("STRLEN(STR(%s) <= %d)", subject, value.parseInteger());
break;
case PATTERN: sparql += String.format("REGEX(STR(%s), %d)", subject, value.parseInteger());
break;
case LANG_RANGE:
break;
case MAX_EXCLUSIVE: sparql += subject + "<" + valueString;
break;
case MAX_INCLUSIVE: sparql += subject + "<=" + valueString;
break;
case MIN_EXCLUSIVE: sparql += subject + ">" + valueString;
break;
case MIN_INCLUSIVE: sparql += subject + ">=" + valueString;
break;
case FRACTION_DIGITS:
break;
case TOTAL_DIGITS:
break;
default:
break;
}
if(iterator.hasNext()) {
sparql += " && ";
}
}
sparql += " && datatype(" + subject + ")=<" + node.getDatatype().toStringID() + ">";
}
开发者ID:SmartDataAnalytics,项目名称:OWL2SPARQL,代码行数:47,代码来源:OWLClassExpressionToSPARQLConverter.java
示例16: instantiate
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
public static OWLFacet instantiate(SerializationStreamReader streamReader) throws SerializationException {
return OWLFacet.valueOf(streamReader.readString());
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:4,代码来源:OWLFacet_CustomFieldSerializer.java
示例17: serialize
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
public static void serialize(SerializationStreamWriter streamWriter, OWLFacet instance) throws SerializationException {
streamWriter.writeString(instance.name());
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:4,代码来源:OWLFacet_CustomFieldSerializer.java
示例18: deserialize
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
public static void deserialize(SerializationStreamReader streamReader, OWLFacet instance) throws SerializationException {
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:3,代码来源:OWLFacet_CustomFieldSerializer.java
示例19: instantiate
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
public static OWLFacetRestrictionImpl instantiate(SerializationStreamReader streamReader) throws SerializationException {
OWLFacet facet = OWLFacet.values()[streamReader.readInt()];
OWLLiteral facetValue = (OWLLiteral) streamReader.readObject();
return new OWLFacetRestrictionImpl(facet, facetValue);
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:6,代码来源:OWLFacetRestrictionImpl_CustomFieldSerializer.java
示例20: getFacet
import org.semanticweb.owlapi.vocab.OWLFacet; //导入依赖的package包/类
@Override
public OWLFacet getFacet() {
return facet;
}
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:5,代码来源:OWLFacetRestrictionImpl.java
注:本文中的org.semanticweb.owlapi.vocab.OWLFacet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论