Hello Stephan
I've said this in the previous message, but you may have missed it.... so let me
try again without embedding it in the trail that's gone before.
In the HTML renderings:
a) URI nodes in subject or object positions are labelled with:
i) rdfs:label if present in the response graph
ii) skos:prefLabel if present in response graph
i) and ii) precidence may be the reverse of this.
iii) Otherwise property short name
This is behaviour induced by the XSL stylesheet
b) URI nodes in the property position of a statement are labelled with
a rending of their short name (the XSL an uncamel casing approach).
c) Short names for properties come from:
i) api:label statements in the API configuration (if present)
ii) URI localname and prefix if the local name is admissable as a shortname
and (since elda versions after 1.2.13) the prefix is defined in the API
config file.
iii) Otherwise, (since elda version after 1.2.13) a %-encoded mangling of the
property URI so that property filtering and projection can still be
accomplished
(the XSL embeds many such links - which would otherwise 404). If you
encounter
these, your minimal response its likely to add the prefix defn to the
API config,
and more like you'll want to take full control of the shortname.
Key point is that the labelling source for URI in property positions is
*different* from labelling source for URI in subject and object positions of a
response.
Stuart
--
[Feeling that there is no more light to shed]
> I looked at the sample specs to try to understand why the HTML from the sample APIs looked nicer.
>
> I started defining the properties in the spec file and attaching api:label statements to them which resolved the issue of the undesired prefix in the label name, but I then ran into an issue of not being able to leverage spaces in the label value. Based on your feedback, I changed the api:label statements to be rdfs:label statements, but I still get the same issue with spaces in the label.
>
> For example if I use the following in my spec then I see "head honcho" as the property name in the HTML presentation, so the label value is clearly being leveraged.
>
> gcis:hasChiefEditor
> a rdf:Property;
> rdfs:label "headHoncho";
> .
>
> If I use the following, I get "gcis_has chief editor" in the HTML, so the label is being ignored and the label name in the HTML is generated based on the property URI.
>
> gcis:hasChiefEditor
> a rdf:Property;
> rdfs:label "head honcho";
> .
>
> This issue confused me for a while because I did not know what was going on. It appears that if there is a space in the rdfs:label value the XSL stylesheet is applying heuristics to determine the label name from the property URI, whereas if there is no space in the rdfs:label value it is applying a different set of heuristics to the label value to convert camelCase to lowercase with spaces.
>
> I admit I was guessing as to whether labelledDescribeViewer had a connection to any of this. The only documentation I found on labelledDescribeViewer was
>
> api:labelledDescribeViewer is named "all" and returns a graph that is whatever is returned by a DESCRIBE query for the item on the SPARQL endpoint, supplemented by rdfs:label properties for all referenced resources. Again, the precise details of what's returned will depend on the SPARQL endpoint.
>
> from
http://code.google.com/p/linked-data-api/wiki/API_Viewing_Resources
>
> I was not sure if this meant property labels would be picked up as well, but on reflection I supposed they would not.
>
>>
>> For RDF statement subjects and objects - they come from rdfs:label in the data - at least that's what the labelledDescribeViewer 'attracts' into the result graph, though it can be configured for a different property.
>
> Do you have a link to the documentation on this? I have skos and foaf data in my repository so I would like to pull rdfs:label, dct:title, foaf:name, and skos:prefLabel values if available.
>
>> Absent an rdfs:label the XSL stylesheet will applies some heuristics (I don't recall the order) that roughly look for:
>
>>
>> 1) other labelling properties (skos:prefLabel and/or skos:altLabel - in the result graph - the XSL engine doesn't look in the datastore, that query has already happened and the labelledDescribeViewer - if that's what you used - has already had its effect).
>> 2) the localname of the property URI *if* it meets the syntactic constraints required of being a LDA shortname.
>>
>> For RDF statement properties, the labeling comes from the api configuration itself, specifically api:label properties used to establish shortnames.
>
> Ah, this was not intuitive to me. Is it in the documentation somewhere?
>
> From what you are saying I should be using api:label instead of rdfs:label on the properties defined in my spec file and I deduce I need to use camelCase when I want a multi-word label.
>
>>
>>> My spec now defines a property with label as such (should also be defined with this label in the sparql endpoint).
>>>
>>> gcis:hasChiefEditor
>>> a rdf:Property;
>>> rdfs:label "chief editor";
>>> .
>>
>> That won't give you control of a shortname - you need to use api:label for that.
>
> ...and yet it seems to work...
>
>>>
>>> The property is showing up as
>>>
>>> <tr class="gcis_hasChiefEditor">
>>> <th class="label"><a href="
http://data.globalchange.gov/gcis.owl#hasChiefEditor">gcis_has chief editor</a></th><td class="value"><a href="
http://data.globalchange.gov/person/Thomas_R_K">Thomas_R_K</a></td><td class="filter"></td>
>>> </tr>
>>
>> Ah... that's because absent a shortname elda has *made one up* using the property URIs local name and a matching prefix (gcis in this case) visible in the api configuration.
>>
>>> In the HTML generated by my slightly tweaked result.xsl viewer.
>>>
>>> The JSON looks like
>>> {"chief editor" : "
http://data.globalchange.gov/person/Thomas_R_K"}
>>> so the JSON property name looks like it is using the rdfs:label value.
>>>
>>> Perhaps my issue is really just with my XsltFormatter?
>>
>> Hard to say as I for one of lost the plot on what your issue actually is. I'm surprise that you should need to 'tweak' result.xsl over and above some cosmetic changes to change page banners and the like.
>
> Currently cosmetic, but as mentioned above I use geosparql to encode geospatial information so I will have to make changes to the mapping JS scripts.
>
> --Stephan
>
>>
>>>
>>> --Stephan
>>
>> Stuart
>> --
>>
>>>
>>> On Nov 20, 2012, at 11:06 AM, Stuart Williams <
s...@epimorphics.com> wrote:
>>>
>>>> Hello Stephan,
>>>>
> I looked at the sample specs to try to understand why the HTML from the sample
> APIs looked nicer.
>
> I started defining the properties in the spec file and attaching api:label
> statements to them which resolved the issue of the undesired prefix in the label
> name, but I then ran into an issue of not being able to leverage spaces in the
> label value. Based on your feedback, I changed the api:label statements to be
> rdfs:label statements, but I still get the same issue with spaces in the label.
>
> For example if I use the following in my spec then I see "head honcho" as the
> property name in the HTML presentation, so the label value is clearly being
> leveraged.
>
> gcis:hasChiefEditor
> a rdf:Property;
> rdfs:label "headHoncho";
> .
>
> If I use the following, I get "gcis_has chief editor" in the HTML, so the label
> is being ignored and the label name in the HTML is generated based on the
> property URI.
>
> gcis:hasChiefEditor
> a rdf:Property;
> rdfs:label "head honcho";
> .
>
> This issue confused me for a while because I did not know what was going on. It
> appears that if there is a space in the rdfs:label value the XSL stylesheet is
> applying heuristics to determine the label name from the property URI, whereas
> if there is no space in the rdfs:label value it is applying a different set of
> heuristics to the label value to convert camelCase to lowercase with spaces.
>
> I admit I was guessing as to whether labelledDescribeViewer had a connection to
> any of this. The only documentation I found on labelledDescribeViewer was
>
> api:labelledDescribeViewer is named "all" and returns a graph that is whatever
> is returned by a DESCRIBE query for the item on the SPARQL endpoint,
> supplemented by rdfs:label properties for all referenced resources. Again, the
> precise details of what's returned will depend on the SPARQL endpoint.
>
> from
http://code.google.com/p/linked-data-api/wiki/API_Viewing_Resources
>
> I was not sure if this meant property labels would be picked up as well, but on
> reflection I supposed they would not.
>
>>
>> For RDF statement subjects and objects - they come from rdfs:label in the data
>> - at least that's what the labelledDescribeViewer 'attracts' into the result
>> graph, though it can be configured for a different property.
>
> Do you have a link to the documentation on this? I have skos and foaf data in
> my repository so I would like to pull rdfs:label, dct:title, foaf:name, and
> skos:prefLabel values if available.
>
>> Absent an rdfs:label the XSL stylesheet will applies some heuristics (I don't
>> recall the order) that roughly look for:
>
>>
>> 1) other labelling properties (skos:prefLabel and/or skos:altLabel - in the
>> result graph - the XSL engine doesn't look in the datastore, that query has
>> already happened and the labelledDescribeViewer - if that's what you used -
>> has already had its effect).
>> 2) the localname of the property URI *if* it meets the syntactic constraints
>> required of being a LDA shortname.
>>
>> For RDF statement properties, the labeling comes from the api configuration
>> itself, specifically api:label properties used to establish shortnames.
>
> Ah, this was not intuitive to me. Is it in the documentation somewhere?
>
> From what you are saying I should be using api:label instead of rdfs:label on
> the properties defined in my spec file and I deduce I need to use camelCase when
> I want a multi-word label.
>
>>
>>> My spec now defines a property with label as such (should also be defined
>>> with this label in the sparql endpoint).
>>>
>>> gcis:hasChiefEditor
>>> a rdf:Property;
>>> rdfs:label "chief editor";
>>> .
>>
>> That won't give you control of a shortname - you need to use api:label for that.
>
> ...and yet it seems to work...
>
>>>
>>> The property is showing up as
>>>
>>> <tr class="gcis_hasChiefEditor">
>>> <th class="label"><a
>>> href="
http://data.globalchange.gov/gcis.owl#hasChiefEditor">gcis_has chief
>>> editor</a></th><td class="value"><a
>>> href="
http://data.globalchange.gov/person/Thomas_R_K">Thomas_R_K</a></td><td
>>> class="filter"></td>
>>> </tr>
>>
>> Ah... that's because absent a shortname elda has *made one up* using the
>> property URIs local name and a matching prefix (gcis in this case) visible in
>> the api configuration.
>>
>>> In the HTML generated by my slightly tweaked result.xsl viewer.
>>>
>>> The JSON looks like
>>> {"chief editor" : "
http://data.globalchange.gov/person/Thomas_R_K"}
>>> so the JSON property name looks like it is using the rdfs:label value.
>>>
>>> Perhaps my issue is really just with my XsltFormatter?
>>
>> Hard to say as I for one of lost the plot on what your issue actually is. I'm
>> surprise that you should need to 'tweak' result.xsl over and above some
>> cosmetic changes to change page banners and the like.
>
> Currently cosmetic, but as mentioned above I use geosparql to encode geospatial
> information so I will have to make changes to the mapping JS scripts.
>
> --Stephan
>
>>
>>>
>>> --Stephan
>>
>> Stuart
>> --
>>
>>>
>>> On Nov 20, 2012, at 11:06 AM, Stuart Williams <
s...@epimorphics.com
>>> <mailto:
s...@epimorphics.com>> wrote:
>>>
>>>> Hello Stephan,
>>>>
>>>> api:label is purely used for associating a shortname with a URI (class,
>>>> property or instance) so that you can create filters and viewers
>>>> (property-chain viewers).
>>>>
>>>> The labelledDescribeViewer, by default, seeks to obtain rdfs:labels for
>>>> every subject/object (inc closures over b-nodes) mentioned in a response.
>>>>
>>>> There should be no problem with spaces in your rdfs:labels.
>>>>
>>>> If you want to pick different property for the labelledDescribeViewer to
>>>> retrieve (eg. skos:prefLabel) there is a way to configure elda to do so.
>>>>
>>>> api:labels are part of the api configuration whereas you'd normally expect
>>>> to use rdfs:label, skos:prefLabel and/or skos:altLabel in the data you are
>>>> serving.
>>>>
>>>> HTH
>>>>
>>>> Stuart
>>>> --
>>>> On 20/11/2012 17:46, Stephan Zednik wrote:
>>>>>
>>>>> On Nov 20, 2012, at 1:37 AM, chris dollin <
ehog....@googlemail.com
>>>>>> <mailto:
lokip...@gmail.com>> wrote:
>>>>>>
>>>>>>>
>>>>>>> I like the idea of api:labelledDescribeViewer but in usage it is being very
>>>>>>> hit or miss with existing labels since many of the labels I am working with
>>>>>>> have spaces in them. It took me a while to figure out that spaces were the
>>>>>>> cause since the restriction was non-intuitive to me.
>>>>>>
>>>>>> I don't understand. The labels used in the data returned by a
>>>>>> labelled-describe viewer have nothing to do with shortnames.
>>>>>
>>>>> I might have wrongly assumed you needed to specify a labelledDescribeViewer
>>>>> to leverage the api:label values. The connections are not clearly
>>>>> documented so I am making assumptions based on the examples.
>>>>>
>>>>> Whether a labelled viewer is needed or not, I like the idea of being able
>>>>> to leverage labels in the viewers. Unfortunately, a great deal of the RDF
>>>>> I am using has spaces in property & class labels.
>>>>>
>>>>> --Stephan
>>>>>
>>>>>>
>>>>>> Could you give us a specific example?
>>>>>>
>>>>>> Chris
>>>>>>
>>>>>> --
>>>>>> Chris "allusive" Dollin
>>>>>
>>>>
>>>> --
>>>> Epimorphics Ltd
www.epimorphics.com <
http://www.epimorphics.com>
>>>> Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
>>>> Tel: 01275 399069
>>>>
>>>> Epimorphics Ltd. is a limited company registered in England (number 7016688)
>>>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
>>>> 6PT, UK
>>>
>>>
>>
>> --
>> Epimorphics Ltd
www.epimorphics.com <
http://www.epimorphics.com>