0

I need to read a RDF/XML file from a website but haven't figured out how yet after reading some other posts and have no previous experience with such files.

Ideally I would convert this file to be dealt with Excel as a bunch of data, can anyone guide me a hint with the file?

unor
  • 92,415
  • 26
  • 211
  • 360
Arduino
  • 373
  • 1
  • 3
  • 21
  • An rdf file is metadata. Parse the metadata or open it as an xml file. –  Mar 27 '18 at 21:52
  • You can read the RDF using Apache Jena and write it to Excel using Apache POI for example. – Henriette Harmse Mar 28 '18 at 05:17
  • We don't know the programming language, but you should be able to search for RDF frameworks in the appropriate language, or not? Excel = CSV, thus, RDF to CSV/TSV which is trivial for e.g. N-Triples format – UninformedUser Mar 28 '18 at 07:38
  • There are tools with which you can run SPARQL queries on RDF files. Then you can export the result as CSV. – Ivo Velitchkov Mar 28 '18 at 19:10

1 Answers1

2

You can easily get a table of all triples in your file, using for example the Structured Data Sniffer, which is a browser extension. This would be the result. If you change "uri=&query=" with "uri=&qtxt=", you'll enter edit mode. There you can choose CSV or another result format.

Yet, having the list of triples would not be a very useful result, so you need to explore your data. A good starting point would be to run

SELECT DISTINCT ?property
FROM <http://www.bcn.cat/tercerlloc/serveis_socials.rdf>
WHERE {
  ?s ?property ?o .
}

This will give you the list of properties, a subset of which you'd finally use as columns of your result table. Then you can run other exploratory queries, until you get sufficient understanding of your data set.

Ivo Velitchkov
  • 2,361
  • 11
  • 21