RDFLib/rdflib — Issue #172: feature: Graph.preferredLabel() (skos:prefLabel before rdfs:label)
Author: gjhiggins
Created: 2012-02-20 08:34:22+00:00
State: open

joernhees, 2011-08-26T11:21:41.000Z

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

Comment 1 by gjhigg...@gmail.com
Looks useful. Thank you for the contribution - effected in changeset 17650fe3ed7b