如何将 OWLClassExpression 序列化为三元组

问题描述 投票:0回答:1

我正在尝试解析曼彻斯特语法类表达式,并检索其相应的 RDF 序列化三元组。这个问题对我帮助很大:OWLAPI:使用 ManchesterOWLSyntaxParser 将字符串转换为类表达式时出现“ParserException”。

我想从

Pizza and (not (hasTopping some FishTopping)) and (not (hasTopping some MeatTopping))

移动到

(_:fe7fad725e5c44e081bfa45c97ad15731, http://www.w3.org/2002/07/owl#intersectionOf, _:fe7fad725e5c44e081bfa45c97ad15732) [null] (_:fe7fad725e5c44e081bfa45c97ad15731, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Class) [null] (_:fe7fad725e5c44e081bfa45c97ad15732, http://www.w3.org/1999/02/22-rdf-syntax-ns#first, http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza) [null] (_:fe7fad725e5c44e081bfa45c97ad15732, http://www.w3.org/1999/02/22-rdf-syntax-ns#rest, _:fe7fad725e5c44e081bfa45c97ad15733) [null] (_:fe7fad725e5c44e081bfa45c97ad15733, http://www.w3.org/1999/02/22-rdf-syntax-ns#first, _:fe7fad725e5c44e081bfa45c97ad15734) [null] (_:fe7fad725e5c44e081bfa45c97ad15733, http://www.w3.org/1999/02/22-rdf-syntax-ns#rest, _:fe7fad725e5c44e081bfa45c97ad15736) [null] (_:fe7fad725e5c44e081bfa45c97ad15734, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Class) [null] (_:fe7fad725e5c44e081bfa45c97ad15734, http://www.w3.org/2002/07/owl#complementOf, _:fe7fad725e5c44e081bfa45c97ad15735) [null] (_:fe7fad725e5c44e081bfa45c97ad15735, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Restriction) [null] (_:fe7fad725e5c44e081bfa45c97ad15735, http://www.w3.org/2002/07/owl#onProperty, http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping) [null] (_:fe7fad725e5c44e081bfa45c97ad15735, http://www.w3.org/2002/07/owl#someValuesFrom, http://www.co-ode.org/ontologies/pizza/pizza.owl#FishTopping) [null] (_:fe7fad725e5c44e081bfa45c97ad15736, http://www.w3.org/1999/02/22-rdf-syntax-ns#first, _:fe7fad725e5c44e081bfa45c97ad15737) [null] (_:fe7fad725e5c44e081bfa45c97ad15736, http://www.w3.org/1999/02/22-rdf-syntax-ns#rest, http://www.w3.org/1999/02/22-rdf-syntax-ns#nil) [null] (_:fe7fad725e5c44e081bfa45c97ad15737, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Class) [null] (_:fe7fad725e5c44e081bfa45c97ad15737, http://www.w3.org/2002/07/owl#complementOf, _:fe7fad725e5c44e081bfa45c97ad15738) [null] (_:fe7fad725e5c44e081bfa45c97ad15738, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#Restriction) [null] (_:fe7fad725e5c44e081bfa45c97ad15738, http://www.w3.org/2002/07/owl#onProperty, http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping) [null] (_:fe7fad725e5c44e081bfa45c97ad15738, http://www.w3.org/2002/07/owl#someValuesFrom, http://www.co-ode.org/ontologies/pizza/pizza.owl#MeatTopping) [null]
我可以从原始字符串获取

OWLClassExpression。但那么我如何从 OWLClassExpression

 中获取相应的三元组集合呢?

谢谢!

java owl ontology owl-api manchester-syntax
1个回答
0
投票
将类放入公理中,将公理放入本体中,并以面向三元组的格式(例如 ntriples)保存。

© www.soinside.com 2019 - 2024. All rights reserved.