Data property assertions

22 views
Skip to first unread message

anu

unread,
Mar 18, 2011, 11:34:55 PM3/18/11
to skos-dev
Is there any separate method in SKOS api for retrieving the alt
label,prefered label,definition and scope notes seperately from the
data property assertions....Can anyone guide me in this...???

Simon Jupp

unread,
Mar 21, 2011, 8:07:35 AM3/21/11
to skos...@googlegroups.com
Not really, you need to filter them out yourself. For example, to get all the labels on a concept you can use code similar to this:

// get any pref labels
for (SKOSLiteral constant : concept.getSKOSRelatedConstantByProperty(dataset, factory.getSKOSPrefLabelProperty())) {

// need to filter for types or untyped constants
if (constant instanceof SKOSUntypedLiteral) {
SKOSUntypedLiteral untypedConstant = (SKOSUntypedLiteral) constant;
System.out.println("PrefLabel: " + untypedConstant.getLiteral() + " lang: " + untypedConstant.getLang());
}
}

Cheers
Simon

> --
> You received this message because you are subscribed to the Google Groups "skos-dev" group.
> 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.
>

Simon Jupp
simon...@manchester.ac.uk
http://www.cs.man.ac.uk/~sjupp/


anu

unread,
Apr 5, 2011, 10:42:44 PM4/5/11
to skos-dev
i got the preffred labels and alternate labels seprately.......

but I am unable to get the desired definition and scope note property
of data assertions..


for (SKOSLiteral constant : con.getSKOSRelatedConstantByProperty(da,
datafac.getSKOSDefinitionDataProperty()))
{
// need to filter for types or untyped
constants
if (constant instanceof SKOSUntypedLiteral)
{
System.out.println("The Definition
of the concept is");
SKOSTypedLiteral untypedConstant =
(SKOSTypedLiteral) constant;



System.out.println( untypedConstant.getLiteral());

}

}
for this above code..am nt getting the output..what should i change to
get the answer
Reply all
Reply to author
Forward
0 new messages