way to Navigation in the Skos trees

37 views
Skip to first unread message

Paola Montorio

unread,
May 11, 2012, 10:11:35 AM5/11/12
to skos...@googlegroups.com
Hi Simon,
I have the following important question:
Can I navigate in the skos file , with java skos api, by setting the entity name in the concept class?

 By studying the documents of skos api there are not the Set Methods for entity name settings or property name settings. Actually there are only the possibilities and the ways to navigate the skos trees with a loop for like this:

...................................................................
for (SKOSConcept concept : dataset.getSKOSConcepts()) {
                for (SKOSAnnotation assertion : dataset.getSKOSAnnotations(concept)) {
                    String value = "";
                        // annotation is some resource
                        SKOSEntity entity = assertion.getAnnotationValue();
                        value = entity.getURI().getFragment();
                    System.out.println(" rel: " + assertion.getURI().getFragment());
                    System.out.println("value: " + value );
                }
                System.out.println(" --------------------- ");
            }
..................................................................
Is the only way navigation trees?
Thanks in advance for you help,
ciao
Paola

Simon Jupp

unread,
May 16, 2012, 3:45:07 AM5/16/12
to skos...@googlegroups.com
Hi Paola,
I'm not sure what you mean about navigating the file, do you want to
navigate the SKOS broader/narrower hierarchy?
Simon
> --
> You received this message because you are subscribed to the Google Groups
> "skos-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/skos-dev/-/6K5ouKor9yEJ.
> To post to this group, send email to skos...@googlegroups.com.
> To unsubscribe from this group, send email to
> skos-dev+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/skos-dev?hl=en.

Paola Montorio

unread,
May 16, 2012, 6:08:36 AM5/16/12
to skos...@googlegroups.com
Hi Simon,
I would like to
navigate the file owl with the method of SKOSConcept:
-------
SKOSConpept c = dataset.getSKOSConcepts ();
java.util.Set <SKOSEntity> EntitySet_broader = c.getSKOSRelatedEntitiesByProperty (dataset, factory.getSKOSBroaderProperty())
java.util.Set <SKOSEntity> EntitySet_narrower = c.getSKOSRelatedEntitiesByProperty (dataset, factory.getSKOSNarrowerProperty())

 -----
but does not work,
EntitySet_broader and EntitySet_narrower are always empty set
where is the error?
Thanks in advance
bye
Paola
> skos-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/skos-dev?hl=en.
> skos-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/skos-dev?hl=en.
> skos-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/skos-dev?hl=en.
> skos-dev+unsubscribe@googlegroups.com.

Simon Jupp

unread,
May 16, 2012, 6:40:24 AM5/16/12
to skos...@googlegroups.com
That should work. How was the SKOS you are working with generated?
I've noticed that the OWL API parse sometimes interprets SKOS broader
properties as annotation rather than object properties.

You can easily test this in your code, try

java.util.Set <SKOSAnnotation> AnnotationSet_broader =
concept.getSKOSAnnotationsByURI(dataset,
factory.getSKOSBroaderProperty().getURI());

Is the annotation set also empty?

On Wed, May 16, 2012 at 11:08 AM, Paola Montorio
>> > skos-dev+u...@googlegroups.com.
>> > skos-dev+u...@googlegroups.com.
>> > skos-dev+u...@googlegroups.com.
>> > skos-dev+u...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/skos-dev?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "skos-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/skos-dev/-/c1UCS_1D0u8J.
>
> To post to this group, send email to skos...@googlegroups.com.
> To unsubscribe from this group, send email to
> skos-dev+u...@googlegroups.com.

Paola Montorio

unread,
May 16, 2012, 7:45:48 AM5/16/12
to skos...@googlegroups.com
Thank you Simon!
It work fine now with "factory.getSKOSBroaderProperty().getURI()" in the step:
---
concept.getSKOSAnnotationsByURI(dataset, factory.getSKOSBroaderProperty().getURI())
---
Thanks a lot!
Paola
>> > skos-dev+unsubscribe@googlegroups.com.
>> > skos-dev+unsubscribe@googlegroups.com.
>> > skos-dev+unsubscribe@googlegroups.com.
>> > skos-dev+unsubscribe@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/skos-dev?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "skos-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/skos-dev/-/c1UCS_1D0u8J.
>
> To post to this group, send email to skos...@googlegroups.com.
> To unsubscribe from this group, send email to
> skos-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages