How to search values in attributes and retrieve them?

21 views
Skip to first unread message

Go S

unread,
Mar 25, 2019, 12:30:25 PM3/25/19
to EasyRdf Discussion
Hello like-minded people!
I have two questions regarding processing RDF.

I have RDF/XML from GeoNames.
The overall structure of an entity looks like this:
<rdf:RDF>
<gn:Feature rdf:about="http://sws.geonames.org/3166548/"></gn:Feature>
<foaf:Document rdf:about="http://sws.geonames.org/3166548/about.rdf"></foaf:Document>
</rdf:RDF>

From there, I would like to extract all the URLs. For example:
<gn:parentFeature rdf:resource="http://sws.geonames.org/6541466/"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2006-01-15</dcterms:created>

To this end,
1) How can I search values (i.e. regular expression for "http://") in attributes?
2) After that, how can I fetch the string value of the attributes (i.e. http://sws.geonames.org/6541466/ and http://www.w3.org/2001/XMLSchema#date)?

Can anyone help on those? Many thanks in advance!
Go
Reply all
Reply to author
Forward
0 new messages