walidazizi / rdflib

Automatically exported from code.google.com/p/rdflib
Other
0 stars 0 forks source link

feature: Graph.preferredLabel() (skos:prefLabel before rdfs:label) #186

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I needed an easy way to get labels for a subject, preferring skos:prefLabels 
and filtered by language from an rdflib graph.
Currently there only is a Graph.label(subject) which will give you any existing 
rdfs:label, which won't return skos:prefLabel triples and can't filter for 
language tags.

I implemented Graph.preferredLabel(subject,lang,labelProperties). 
labelProperties (defaults to (skos:prefLabel, rdfs:label)) you can specify the 
preference and filter for lang-tag if wanted.

code can be found here:
http://code.google.com/r/joernhees-rdflib/source/list
rev: d5d2203b07cf to b982c0fc9443

Original issue reported on code.google.com by joernhees2 on 26 Aug 2011 at 11:21

GoogleCodeExporter commented 8 years ago
Looks useful. Thank you for the contribution - effected in changeset 
17650fe3ed7b

Original comment by gjhigg...@gmail.com on 26 Oct 2011 at 2:26