gjhiggins/rdflib — Issue #185: feature: Graph.preferredLabel() (skos:prefLabel before rdfs:label)
Author: gjhiggins
Created: 2011-10-19 01:37:06+00:00
State: open

Originally filed by joernh...@gmail.com on 2011-08-26T11:21:41

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