Hi,
the CSW record contains a number of element looking like this:
<?xml version="1.0" encoding="UTF-8"?>
<csw:Record xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ows="http://www.opengis.net/ows"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dct="http://purl.org/dc/terms/">
<dc:identifier>urn:uuid:88247b56-4cbc-4df9-9860-db3f8042e357</dc:identifier>
<dc:type>http://purl.org/dc/dcmitype/Dataset</dc:type>
<dc:subject scheme="http://www.digest.org/2.1
">Physiography-Landforms</dc:subject>
<dct:spatial>FI-ES</dct:spatial>
<dct:abstract>Donec scelerisque pede ut nisl luctus accumsan. Quisque
ultrices, lorem eget feugiat fringilla, lorem dui porttitor ante, cursus
ultrices magna odio eu neque.</dct:abstract>
</csw:Record>
identifier, type, subject, spatial and abstract all have the same type,
SimpleLiteral,
which has a simple content, but that can have that scheme attribute, making
it
a complex attribute with simple content.
So far I've modelled it as a ComplexType with two attributes, scheme and
value:
TypeBuilder builder = new TypeBuilder(typeFactory);
// create the SimpleLiteral type
builder.setNamespaceURI(DC.SimpleLiteral.getNamespaceURI());
builder.name("scheme");
builder.bind(URI.class);
AttributeType schemeType = builder.attribute();
builder.setNamespaceURI(DC.SimpleLiteral.getNamespaceURI());
builder.name("value");
builder.bind(Object.class);
AttributeType valueType = builder.attribute();
builder.setNillable(true);
builder.addAttribute("scheme", schemeType);
builder.addAttribute("value", valueType);
builder.setName("SimpleLiteral");
That works data storage wise, but geotools filtering wise it has a problem,
if I want
to check if a certain simple literal has a certain value I have to use a
xpath
looking like "dc:identifier/dc:value", in particular:
NSS = new NamespaceSupport();
...
Filter f = FF.equals(FF.property("dc:identifier/dc:value", NSS),
FF.literal("urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd"));
This is not ideal I would like to be able to just use:
FF.property("dc:identifier", NSS)
since that's how the filters are expressed in CSW, but how do I make it
work?
Can a complex attribute have a "default" property?
Or will have I to roll out my own custom property accessor?
Cheers
Andrea
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel