You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Michel Benevento <mb...@kanker.nl> on 2012/03/24 02:09:07 UTC

RDF/SKOS question

Hello everyone,

This is a post about RDF and SKOS in general and only slightly about Stanbol, so there may be more appropriate venues to pose these questions (please let me know). But I thought I'd tap in to the collective brainpower on this list anyway.

I am struggling with the design of my thesaurus. I have a cancer related SKOS thesaurus full of concepts decorated with standard broader, narrower and related terms. What I would like to do is add some other semantic relations between these concepts (such as concept A (remedy) is a treatment for concept B (disease)).

I have tried to add my own namespace with these relations , but haven't been able to do this  (see below), so I'm guessing this might not be the way to go. I have also learned that skos has a thing called skos:semanticRelation, but I don't really get what such a generic class would achieve without a lot of redundant rdf:id (I think) attributes.

So what would be the best way to go about this? I would be most grateful if you could set me on the right path, or let me know where I can get this kind of help.

Thanks,
Michel

PS: To illustrate what I tried, here is a simplified snippet of my inputfile.
---------------
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:tzw="http://www.tzw.nl/schema#"
>

<skos:Concept rdf:about="http://www.kanker.nl/rdf#alvleesklierkanker">
<skos:prefLabel>Alvleesklierkanker</skos:prefLabel>
<tzw:treatment rdf:resource="http://www.kanker.nl/rdf#bestraling" />
</skos:Concept>
<skos:Concept rdf:about="http://www.kanker.nl/rdf#bestraling">
<skos:prefLabel>Bestraling</skos:prefLabel>
<tzw:indication rdf:resource="http://www.kanker.nl/rdf#alvleesklierkanker" />
</skos:Concept>
</rdf:RDF>
----------

I added the following to my mappings.txt and the indexing goes OK, but I am never able to query tzw:treatment (namespace tzw is not defined!).

http://www.kanker.nl/rdf#*
tzw:*

I have also tried various mappings (tzw:treatment > skos:related or even > skos:treatment) with various success, but I never seem to really get it right. My understanding is there is a fixed set of hardcoded namespaces that Stanbol relies on? Or is there an easy way to add one?


Re: RDF/SKOS question

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi

On 24.03.2012, at 02:09, Michel Benevento wrote:

> Hello everyone,
> 
> This is a post about RDF and SKOS in general and only slightly about Stanbol, so there may be more appropriate venues to pose these questions (please let me know). But I thought I'd tap in to the collective brainpower on this list anyway.
> 
> I am struggling with the design of my thesaurus. I have a cancer related SKOS thesaurus full of concepts decorated with standard broader, narrower and related terms. What I would like to do is add some other semantic relations between these concepts (such as concept A (remedy) is a treatment for concept B (disease)).
> 

You must be clear about your goals! Do you want to create a Thesaurus, or a formal model describing you problem domain? In general it is fine to use standard because this ensures interoperability, but it can be also dangerous if this means that the model you create is of lower quality.

> I have tried to add my own namespace with these relations , but haven't been able to do this  (see below), so I'm guessing this might not be the way to go. I have also learned that skos has a thing called skos:semanticRelation, but I don't really get what such a generic class would achieve without a lot of redundant rdf:id (I think) attributes.
> 

skos:semanticRelation, skos:transitiveBroader and skos:transitiveNarrower are "abstract" super concepts that should not be instantiated - used to relate concepts. They are only useful for queries and reasoning - e.g. a SPARQL query searching for "<concept-1> skos:semanticRelation ?> will return all concepts that are referred by <concept-1>.


> So what would be the best way to go about this? I would be most grateful if you could set me on the right path, or let me know where I can get this kind of help.
> 

I am +1 for the approach of using your own 

* properties such as "twz:indication" , "twz:treatment" ..
* classes such as "twz:Disease", "twz:treatment"

because this will allow to describe you domain more precisely. I also can imagine that such more specific properties will it make more easy for users to create the domain model.

If you still want to be compatible to SKOS this can be solved at TBox (terminology) level - by defining an alignment of your ontology to SKOS.

e.g. defining

    twz:Disease rdfs:subClassOf skos:Concept
    twz:indication rdfs:subPropertyOf skos:related
    …

Such definitions will allow users and systems that want/need to use SKOS to easily transform your domain model to SKOS. 


> 
> PS: To illustrate what I tried, here is a simplified snippet of my inputfile.
> ---------------
> <rdf:RDF
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> xmlns:skos="http://www.w3.org/2004/02/skos/core#"
> xmlns:tzw="http://www.tzw.nl/schema#"
>> 
> 
> <skos:Concept rdf:about="http://www.kanker.nl/rdf#alvleesklierkanker">
> <skos:prefLabel>Alvleesklierkanker</skos:prefLabel>
> <tzw:treatment rdf:resource="http://www.kanker.nl/rdf#bestraling" />
> </skos:Concept>
> <skos:Concept rdf:about="http://www.kanker.nl/rdf#bestraling">
> <skos:prefLabel>Bestraling</skos:prefLabel>
> <tzw:indication rdf:resource="http://www.kanker.nl/rdf#alvleesklierkanker" />
> </skos:Concept>
> </rdf:RDF>
> ----------
> 

This looks fine to me!

> I added the following to my mappings.txt and the indexing goes OK, but I am never able to query tzw:treatment (namespace tzw is not defined!).
> 
> http://www.kanker.nl/rdf#*

this works for indexing

> tzw:*

this will not work.


> I have also tried various mappings (tzw:treatment > skos:related or even > skos:treatment) with various success, but I never seem to really get it right. My understanding is there is a fixed set of hardcoded namespaces that Stanbol relies on? Or is there an easy way to add one?


Correct prefixes only work for Namespaces statically defined in [1]. Stanbol is still missing a service that allows to define additional prefixes. Because of that you will need to use the full uri in both the queries and the configurations.
(e.g. "http://www.kanker.nl/rdf#treatment" instead of tzw:treatment)

If you define in the mappings

   http://www.kanker.nl/rdf#*
   http://www.kanker.nl/rdf#treatment > skos:related

than you will have both relations present in the indexed data.

best
Rupert

[1] http://svn.apache.org/repos/asf/incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/NamespaceEnum.java

Re: RDF/SKOS question

Posted by Alessandra Donnini <a....@etcware.it>.
Ciao Michel
to answer your question I'd like to know how you did the thesaurus.  If you put everything in SKOS, the thesaurus can consists of a top  concept health care, and a top concept diseases, with more specific concepts (narrower) with treatment and disease related (skos: related is a relation that you can add to skos concept http://www.w3.org/TR/skos-reference/#semantic-relations).
A very simple query to get all health care related to a specific deseaseX is:
select ?s ?p ?o where {yourThesaurus:deseaseX skos:related ?o}
We have a prototype product to manage SKOS thesaurus with a web administrative interface and an applicative REST interface: Let me know if you're interested to try it. 

Alessandra

Alessandra Donnini
Etcware s.r.l. via Etna 13 - 00141 Roma
a.donnini@etcware.it
mobile +39 333 8914865
tel/fax 06 64495131





Il giorno 26/mar/2012, alle ore 10.08, Michel Benevento ha scritto:

> Ciao Alessandra,
> 
> But just using the generic 'related' property would rely on knowing where a certain concept is of class 'treatment' or 'disease', right? We'd need to add that classification to our thesaurus. For academia's sake, how would one do that in SKOS? By using 'broader' terms? How can this then be efficiently queried if I want to find all treatments for a certain disease?
> 
> Please be as elaborate as you can, I'm affaid I still have very little traction here...
> 
> Thanks,
> Michel
> 
> 
> 
> On 24 mrt. 2012, at 07:07, Alessandra Donnini wrote:
> 
>> Hi Michel in my opinion the relations between concept can be assessed by using the standard relationship skos:related.
>> Alessandra
>> 
>> Inviato da iPad
>> 
>> Il giorno 24/mar/2012, alle ore 02:09, Michel Benevento <mb...@kanker.nl> ha scritto:
>> 
>>> Hello everyone,
>>> 
>>> This is a post about RDF and SKOS in general and only slightly about Stanbol, so there may be more appropriate venues to pose these questions (please let me know). But I thought I'd tap in to the collective brainpower on this list anyway.
>>> 
>>> I am struggling with the design of my thesaurus. I have a cancer related SKOS thesaurus full of concepts decorated with standard broader, narrower and related terms. What I would like to do is add some other semantic relations between these concepts (such as concept A (remedy) is a treatment for concept B (disease)).
>>> 
>>> I have tried to add my own namespace with these relations , but haven't been able to do this  (see below), so I'm guessing this might not be the way to go. I have also learned that skos has a thing called skos:semanticRelation, but I don't really get what such a generic class would achieve without a lot of redundant rdf:id (I think) attributes.
>>> 
>>> So what would be the best way to go about this? I would be most grateful if you could set me on the right path, or let me know where I can get this kind of help.
>>> 
>>> Thanks,
>>> Michel
>>> 
>>> PS: To illustrate what I tried, here is a simplified snippet of my inputfile.
>>> ---------------
>>> <rdf:RDF
>>> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>>> xmlns:skos="http://www.w3.org/2004/02/skos/core#"
>>> xmlns:tzw="http://www.tzw.nl/schema#"
>>>> 
>>> 
>>> <skos:Concept rdf:about="http://www.kanker.nl/rdf#alvleesklierkanker">
>>> <skos:prefLabel>Alvleesklierkanker</skos:prefLabel>
>>> <tzw:treatment rdf:resource="http://www.kanker.nl/rdf#bestraling" />
>>> </skos:Concept>
>>> <skos:Concept rdf:about="http://www.kanker.nl/rdf#bestraling">
>>> <skos:prefLabel>Bestraling</skos:prefLabel>
>>> <tzw:indication rdf:resource="http://www.kanker.nl/rdf#alvleesklierkanker" />
>>> </skos:Concept>
>>> </rdf:RDF>
>>> ----------
>>> 
>>> I added the following to my mappings.txt and the indexing goes OK, but I am never able to query tzw:treatment (namespace tzw is not defined!).
>>> 
>>> http://www.kanker.nl/rdf#*
>>> tzw:*
>>> 
>>> I have also tried various mappings (tzw:treatment > skos:related or even > skos:treatment) with various success, but I never seem to really get it right. My understanding is there is a fixed set of hardcoded namespaces that Stanbol relies on? Or is there an easy way to add one?
>>> 
> 


Re: RDF/SKOS question

Posted by Michel Benevento <mb...@kanker.nl>.
Ciao Alessandra,

But just using the generic 'related' property would rely on knowing where a certain concept is of class 'treatment' or 'disease', right? We'd need to add that classification to our thesaurus. For academia's sake, how would one do that in SKOS? By using 'broader' terms? How can this then be efficiently queried if I want to find all treatments for a certain disease?

Please be as elaborate as you can, I'm affaid I still have very little traction here...

Thanks,
Michel



On 24 mrt. 2012, at 07:07, Alessandra Donnini wrote:

> Hi Michel in my opinion the relations between concept can be assessed by using the standard relationship skos:related.
> Alessandra
> 
> Inviato da iPad
> 
> Il giorno 24/mar/2012, alle ore 02:09, Michel Benevento <mb...@kanker.nl> ha scritto:
> 
>> Hello everyone,
>> 
>> This is a post about RDF and SKOS in general and only slightly about Stanbol, so there may be more appropriate venues to pose these questions (please let me know). But I thought I'd tap in to the collective brainpower on this list anyway.
>> 
>> I am struggling with the design of my thesaurus. I have a cancer related SKOS thesaurus full of concepts decorated with standard broader, narrower and related terms. What I would like to do is add some other semantic relations between these concepts (such as concept A (remedy) is a treatment for concept B (disease)).
>> 
>> I have tried to add my own namespace with these relations , but haven't been able to do this  (see below), so I'm guessing this might not be the way to go. I have also learned that skos has a thing called skos:semanticRelation, but I don't really get what such a generic class would achieve without a lot of redundant rdf:id (I think) attributes.
>> 
>> So what would be the best way to go about this? I would be most grateful if you could set me on the right path, or let me know where I can get this kind of help.
>> 
>> Thanks,
>> Michel
>> 
>> PS: To illustrate what I tried, here is a simplified snippet of my inputfile.
>> ---------------
>> <rdf:RDF
>> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>> xmlns:skos="http://www.w3.org/2004/02/skos/core#"
>> xmlns:tzw="http://www.tzw.nl/schema#"
>>> 
>> 
>> <skos:Concept rdf:about="http://www.kanker.nl/rdf#alvleesklierkanker">
>> <skos:prefLabel>Alvleesklierkanker</skos:prefLabel>
>> <tzw:treatment rdf:resource="http://www.kanker.nl/rdf#bestraling" />
>> </skos:Concept>
>> <skos:Concept rdf:about="http://www.kanker.nl/rdf#bestraling">
>> <skos:prefLabel>Bestraling</skos:prefLabel>
>> <tzw:indication rdf:resource="http://www.kanker.nl/rdf#alvleesklierkanker" />
>> </skos:Concept>
>> </rdf:RDF>
>> ----------
>> 
>> I added the following to my mappings.txt and the indexing goes OK, but I am never able to query tzw:treatment (namespace tzw is not defined!).
>> 
>> http://www.kanker.nl/rdf#*
>> tzw:*
>> 
>> I have also tried various mappings (tzw:treatment > skos:related or even > skos:treatment) with various success, but I never seem to really get it right. My understanding is there is a fixed set of hardcoded namespaces that Stanbol relies on? Or is there an easy way to add one?
>> 


Re: RDF/SKOS question

Posted by Alessandra Donnini <a....@etcware.it>.
Hi Michel in my opinion the relations between concept can be assessed by using the standard relationship skos:related.
Alessandra

Inviato da iPad

Il giorno 24/mar/2012, alle ore 02:09, Michel Benevento <mb...@kanker.nl> ha scritto:

> Hello everyone,
> 
> This is a post about RDF and SKOS in general and only slightly about Stanbol, so there may be more appropriate venues to pose these questions (please let me know). But I thought I'd tap in to the collective brainpower on this list anyway.
> 
> I am struggling with the design of my thesaurus. I have a cancer related SKOS thesaurus full of concepts decorated with standard broader, narrower and related terms. What I would like to do is add some other semantic relations between these concepts (such as concept A (remedy) is a treatment for concept B (disease)).
> 
> I have tried to add my own namespace with these relations , but haven't been able to do this  (see below), so I'm guessing this might not be the way to go. I have also learned that skos has a thing called skos:semanticRelation, but I don't really get what such a generic class would achieve without a lot of redundant rdf:id (I think) attributes.
> 
> So what would be the best way to go about this? I would be most grateful if you could set me on the right path, or let me know where I can get this kind of help.
> 
> Thanks,
> Michel
> 
> PS: To illustrate what I tried, here is a simplified snippet of my inputfile.
> ---------------
> <rdf:RDF
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> xmlns:skos="http://www.w3.org/2004/02/skos/core#"
> xmlns:tzw="http://www.tzw.nl/schema#"
>> 
> 
> <skos:Concept rdf:about="http://www.kanker.nl/rdf#alvleesklierkanker">
> <skos:prefLabel>Alvleesklierkanker</skos:prefLabel>
> <tzw:treatment rdf:resource="http://www.kanker.nl/rdf#bestraling" />
> </skos:Concept>
> <skos:Concept rdf:about="http://www.kanker.nl/rdf#bestraling">
> <skos:prefLabel>Bestraling</skos:prefLabel>
> <tzw:indication rdf:resource="http://www.kanker.nl/rdf#alvleesklierkanker" />
> </skos:Concept>
> </rdf:RDF>
> ----------
> 
> I added the following to my mappings.txt and the indexing goes OK, but I am never able to query tzw:treatment (namespace tzw is not defined!).
> 
> http://www.kanker.nl/rdf#*
> tzw:*
> 
> I have also tried various mappings (tzw:treatment > skos:related or even > skos:treatment) with various success, but I never seem to really get it right. My understanding is there is a fixed set of hardcoded namespaces that Stanbol relies on? Or is there an easy way to add one?
>