簡體   English   中英

如何在C#模型類中解析RDF本體(龜文件)

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM