[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [lyo-dev] Multi-valued extended properties
|
Martin,
You can provide a Collection as the value for an extended property.
List<String> values = new ArrayList<String>();
values.add("a");
values.add("b");
getExtendedProperties().put(new QName("https://foo#", "bar"),
values);
All of the values in the Collection will be included in the resulting
Model.
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:j.0="https://foo#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
<rdf:Description rdf:nodeID="A1">
...
<j.0:bar
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">b</j.0:bar>
<j.0:bar
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">a</j.0:bar>
</rdf:Description>
</rdf:RDF>
See JenaModelHelper#handleExtendedProperties(). Hope this helps.
Best wishes,
Paul McMahan
IBM Rational
lyo-dev-bounces@xxxxxxxxxxx wrote on 04/24/2013 04:24:42 AM:
> From: Martin P Pain <martinpain@xxxxxxxxxx>
> To: lyo-dev@xxxxxxxxxxx
> Date: 04/24/2013 04:25 AM
> Subject: [lyo-dev] Multi-valued extended properties
> Sent by: lyo-dev-bounces@xxxxxxxxxxx
>
> I notice that AbstractResource's extendedProperties field is a plain
> map. However, RDF supports multi-valued properties (i.e. properties
> with duplicate names). Is there any way to use the
> extendedProperties map in AbstractResource to support duplicate
properties?
>
> Martin
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
> _______________________________________________
> lyo-dev mailing list
> lyo-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/lyo-dev