[英]How to parse the RDF ontology (turtle file) in c# model classes
我有本体文件。 我想在我的图形数据库上编写OData服务。 为此,我需要提供EdmModel来注册我的OData路由。 但是无法完成,因为架构既在ttl文件中,也在服务器中。 根据此博客 ,我们可以通过从服务器获取模式来创建模型。 但是那里的github代码有很多问题。 有谁知道如何将其转换为c#模型类?
我的示例模式为乌龟格式:
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://www.example.com/schema/abc#> .
: a owl:Ontology .
# Class
:Organization a owl:Class ;
rdfs:label "Organization"@en ;
skos:definition ""@en .
# Properties
:Name a owl:DatatypeProperty ;
rdfs:domain :Organization ;
rdfs:range xsd:string .
:CreatedDate a owl:DatatypeProperty ;
rdfs:domain :Organization ;
rdfs:range xsd:dateTime .
# Relation
:hasRole a owl:ObjectProperty ;
rdfs:domain :Organization ;
rdfs:range :Role .
有一些从SPARQL到OData的转换器。 我没有尝试过,但是这里有一些链接。 如果搜索“ odata rdf”或“ odata sparql”,则会在Stack Exchange上找到更多链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.