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

Reply via email to