0

I have been lately trying to describe a given RDB(Relational Database) with specific semantic ontologies, using Virtuoso. The ontologies that i want to use are: dc,foaf,dct,bibo,cito(I am new to this so I didnt quite understand if dc and dct are the same thing).
I have been following this tutorial on how to do this: http://virtuoso.openlinksw.com/whitepapers/relational%20rdf%20views%20mapping.html
My problem is that in this tutorial classes are created from zero while I need to use existing ones. Unfortunately I am not allowed to post the links of the ontologies too.
In particular I want to describe:

An "author" table(a published paper author) that has the following columns:

AuthorID, AuthorName, AuthorMiddleName, AuthorSurname, AuthorURL, AuthorEmail, Department

A "Keywords" table(publication's keywords) with the columns:

PublicationID, Keyword(type of string), KeywordOrder(type of Integer),

A "Publications" table with the columns:

PublicationID, PublicationTitle, MediaType(type of string), PublicationType(Integer), MediaTitle, MediaPublisher, MediaEditors, MediaVolInfo, PublicationYear, PublicationNoOfPages, PublicationPagesInMedium, PublicationFileName, PublicationComments, PublicationRelatedURL, PublicationRelatedURLText, PublicationLocation, PublicationPubURL, DisplayOnMLKD(type of Integer), DisplayOnISKP(type of Integer), DisplayOnWeb(type of Integer)

A "References" table (publication's references) with the columns:

RefID, RefPaperID, RefDetails, RefYear

A "Rights" table (publication's rights) with the columns:

PublicationID, AuthorID, AuthorOrder

I tried doing some of this work but I think I might have some problems.
For example, I am currently trying to express the "Publications" table and in my file I have the following:

@prefix dc:      <http://purl.org/dc/elements/1.1/> .
@prefix db:      <http://lpis.csd.auth.gr/> .
@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
@prefix cito:    <http://purl.org/net/cito/> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct:     <http://purl.org/dc/terms/> .
@prefix bibo:    <http://purl.org/ontology/bibo/> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix map:     <http://lpis.csd.auth.gr#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix vocab:   <http://localhost:2020/vocab/resource/> .
@prefix atr: <http://localhost:8890/rdfv_pt/schemas/authors#> .
@prefix kwrd: <http://localhost:8890/rdfv_pt/schemas/keywords#> .
@prefix pub: <http://localhost:8890/rdfv_pt/schemas/publications#> .
@prefix ref: <http://localhost:8890/rdfv_pt/schemas/references#> .
@prefix rig: http://localhost:8890/rdfv_pt/schemas/rights#> .

pub:Publication a rdfs:Class 
rdfs:label "Publication" ;
rdfs:comment "Publication Class" .

pub:PublicationID a dc:identifier .

pub:PublicationTitle a dc:title .

pub:MediaType a rdf:Property ;
rdfs:domain pub:Publication;
rdfs:range xsd:string ;
rdfs:label "Media type" .

Question 1:

So this is just a fragment but my question here is how do I express that the "Publication" is a class of an existing ontology? As you can see above I am defining from zero the class "Publication".

Question 2(more important):

As you can see in the tutorial, somehow the tables that were imported in the virtuoso tool were mapped to a specific URL. However, I wasn't able to find the URL to each table that I imported to virtuoso and I just put some placeholder URLs (These are the localhost URLs). How can i find out the URL to each of the tables that I imported to virtuoso?

PS. Any information at all would be extremely useful, thank you.

PPS. This is my first post so please excuse my formatting if it's wrong.

4

2 回答 2

4

这可能过于宽泛,因为您已经提出了几个不同的问题,并且没有真正提供足够的信息来让我们清楚地了解您正在尝试做什么。也就是说……</p>

问题一:

所以这只是一个片段,但我的问题是如何表达“出版物”是现有本体的一类?正如您在上面看到的,我从零开始定义“出版物”类。

如果您在纯 RDF 中执行此操作(不使用 OWL 或其他一些本体语言),您只需使用本体中 Publication 类的 URI。例如,如果您http://.../pub73从数据中描述某些资源,并且某些本体中的发布类是http://publication-ontology/Publication,您只需说:

<http://.../pub73> rdf:type <http://publication-ontology/Publication>

如果您正在创建一个 OWL 本体,那么您还应该包含owl:imports声明您正在导入的声明http://publication-ontology/(或该本体的任何本体 IRI),以便您获得所有适当的声明公理。

问题2(更重要):

正如您在教程中看到的那样,在 virtuoso 工具中导入的表不知何故被映射到特定的 URL。但是,我无法找到导入到 virtuoso 的每个表的 URL,我只是放置了一些占位符 URL(这些是 localhost URL)。如何找到我导入到 virtuoso 的每个表的 URL?

请注意,本教程包括一个部分:

关键步骤

根据上面概述的映射过程,确定的一些关键要求是:

  • 为每个表定义一个 RDF 类 IRI
  • 为每个主键列值构建一个主题 IRI
  • 为每个非键列构建谓词 IRI

我对 Virtuoso 不是特别熟悉,但是该教程的后面部分中没有描述这个过程, 从主键和Quad Map Patterns & Quad Storage创建 IRI?也就是说,看起来他们首先在第一个图(有向图)中显示预期的数据模型,然后编写一些 RDFS 来描述它,其中包括类声明,例如(清单 1):

prd:Product a rdfs:Class ;
  rdfs:label "Product" ;
  rdfs:comment "An OpenLink product" .

稍后,他们在清单 5 中定义了一个映射,该映射定义了您将如何开始从自动映射中获取此类的实例:

graph <http://localhost:8890/rdfv_demo/testdata/products#>
subject prd:product_iri(OPLWEB.DBA.PRODUCT.PRODUCT_ID)
predicate rdf:type
object prd:Product

它使用prd:product_iri清单 3 中定义的函数:

sparql

prefix prd: <http://localhost:8890/rdfv_demo/schemas/product#>
create iri class prd:product_iri "http://localhost:8890/rdfv_demo/testdata/products#%s"
    (in product_id varchar not null) .

要断言您的数据行对应于某个其他类的实例,您只需在对应的清单 5 中使用该类的 URI。例如,要创建 type 的东西bibo:Document,您可以执行以下操作:

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix bibo: <…&gt;

graph <…&gt;

subject …
predicate rdf:type
object bibo:Document
于 2014-06-02T12:25:12.933 回答
0

我认为您的问题始于遵循相当旧的白皮书作为指南,而不是更新的文档。我鼓励您通过上述渠道跟进后者。

于 2014-07-02T21:05:43.283 回答