我已经将披萨本体加载到 Stardog 和 Blazegraph 中,以及我编写的一些三元组,包括一个有四个配料的披萨。正如@AKSW 建议的那样,我试图使浇头与众不同。
比萨本体将有趣的比萨定义为具有至少三种配料的比萨。我很确定我启用了 OWL 推理,但Triplestore 都没有说我的披萨很有趣。
任何人都可以向我展示在任何免费提供的三元存储中启用此推断的设置,或者指出我的三元存储做错了什么吗?特别是,我是否应该能够推断出披萨实例、披萨类或两者都是“有趣的”?
有趣的披萨定义:
pizza:InterestingPizza rdf:type owl:Class ;
owl:equivalentClass [ owl:intersectionOf ( pizza:Pizza
[ rdf:type owl:Restriction ;
owl:onProperty pizza:hasTopping ;
owl:minCardinality "3"^^xsd:nonNegativeInteger
]
) ;
rdf:type owl:Class
] ;
rdfs:label "PizzaInteressante"@pt .
我的额外三倍:
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix pizza: <http://www.co-ode.org/ontologies/pizza/pizza.owl#> .
<http://www.co-ode.org/ontologies/pizza/pizza.owl#marksPizzaClass>
a owl:Class ;
owl:equivalentClass [
a owl:Restriction ;
owl:onProperty <http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping> ;
owl:someValuesFrom <http://www.co-ode.org/ontologies/pizza/pizza.owl#CaperTopping>
], [
a owl:Restriction ;
owl:onProperty <http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping> ;
owl:someValuesFrom <http://www.co-ode.org/ontologies/pizza/pizza.owl#JalapenoPepperTopping>
], [
a owl:Restriction ;
owl:onProperty <http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping> ;
owl:someValuesFrom <http://www.co-ode.org/ontologies/pizza/pizza.owl#LeekTopping>
], [
a owl:Restriction ;
owl:onProperty <http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping> ;
owl:someValuesFrom <http://www.co-ode.org/ontologies/pizza/pizza.owl#MozzarellaTopping>
], [
a owl:Restriction ;
owl:onProperty <http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping> ;
owl:someValuesFrom <http://www.co-ode.org/ontologies/pizza/pizza.owl#PineKernels>
] ;
rdfs:subClassOf <http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza> ;
rdfs:label "mark's pizza class" .
<http://www.co-ode.org/ontologies/pizza/pizza.owl#marksPizzaClassMember>
a owl:NamedIndividual, <http://www.co-ode.org/ontologies/pizza/pizza.owl#marksPizzaClass> ;
rdfs:label "a member of the mark's pizza class" .
<http://www.co-ode.org/ontologies/pizza/pizza.owl#marksPizzaInstance>
a owl:NamedIndividual, <http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza> ;
pizza:hasTopping pizza:marksPeppers, pizza:topping1, pizza:topping2, pizza:topping3, pizza:topping4 ;
rdfs:label "mark's pizza instance" .
pizza:marksPeppers
a owl:NamedIndividual, pizza:JalapenoPepperTopping ;
rdfs:label "mark's special spicy jalapenos" .
pizza:topping1
a owl:NamedIndividual, pizza:MozzarellaTopping ;
rdfs:label "mark's semi secret topping one" .
pizza:topping2
a owl:NamedIndividual, pizza:PineKernels ;
rdfs:label "mark's semi secret topping two" .
pizza:topping3
a owl:NamedIndividual, pizza:CaperTopping ;
rdfs:label "mark's semi secret topping three" .
pizza:topping4
a owl:NamedIndividual, pizza:LeekTopping ;
rdfs:label "mark's semi secret topping four" .
[]
a owl:AllDifferent ;
owl:distinctMembers (
pizza:marksPeppers
pizza:topping1
pizza:topping2
pizza:topping3
pizza:topping4
) .
查询有关具有五种不同浇头的披萨实例的任何知识:
prefix pizza: <http://www.co-ode.org/ontologies/pizza/pizza.owl#>
select *
where
{ pizza:marksPizzaInstance ?p ?o }
Stardog 的结果 (我手动将完整的 URI 替换为前缀 URI):
+---------------------+----------------------------+
| p | o |
+---------------------+----------------------------+
| pizza:hasIngredient | pizza:topping1 |
| pizza:hasIngredient | pizza:topping2 |
| pizza:hasIngredient | pizza:topping3 |
| pizza:hasIngredient | pizza:topping4 |
| pizza:hasIngredient | pizza:marksPeppers |
| pizza:hasTopping | pizza:topping1 |
| pizza:hasTopping | pizza:topping2 |
| pizza:hasTopping | pizza:topping3 |
| pizza:hasTopping | pizza:topping4 |
| pizza:hasTopping | pizza:marksPeppers |
| rdfs:label | mark's pizza instance |
| rdf:type | owl:Thing |
| rdf:type | pizza:DomainConcept |
| rdf:type | pizza:Food |
| rdf:type | pizza:Pizza |
| rdf:type | pizza:SpicyPizza |
| rdf:type | pizza:SpicyPizzaEquivalent |
| rdf:type | pizza:CheeseyPizza |
| rdf:type | pizza:marksPizzaClass |
+---------------------+----------------------------+
Stardog推断我的披萨有配料(因为它有配料),我的披萨是一种食物,甚至我的披萨也很辣,因为它有马克的墨西哥胡椒作为配料。但它并没有推断出有趣的比萨课的成员资格。
这是我的 Stardog 推理设置:
Reasoning type: SL
Reasoning approximate: ON
SameAs reasoning: FULL
TBox named graph: *