[Home] [By Thread] [By Date] [Recent Entries]
As has already been pointed out - this might well seem dreamy on XML-DEV but in the RDF world it's pretty much what drew most of us to the technology. Most RDF toolkits try to make it easy to consolidate information from various sources and formats into its common graph model. They will usually do some subset of the more explicitly RDF-flavoured formats, e.g. RDF/XML, Turtle, RDFa, JSON-LD, N-Triples, Trig, ... etc. But there will also be an API that can be called programmatically, to create triples from anything you have programmatic access to. You'll find XML adaptors of various kinds (XSLT being the most obvious). Back in the day there were angsty debates about schema annotation for mapping to triples. For example see https://www.w3.org/2003/02/schema-annotation ... although those things never turned out to be as important and central as folks thought. RDF folk spend much of their time moving all kinds of data into RDF graphs/triples. But so much of this grungy data cleaning work is necessarily custom, per-dataset, per-application, ... limiting the value of generic conversion tools. At W3C we did have something called GRDDL that's also close to the picture outlined here - https://en.wikipedia.org/wiki/GRDDL - but in my experience it is rarely used. Finally - there is a ton of non imaginary RDF data out there. You might look at Schema.org - widely used for in-page markup, e.g. see http://webdatacommons.org/structureddata/schemaorgtables/ or for what we've been up to at Google, https://developers.google.com/search/docs/advanced/structured-data/search-gallery Or at Wikidata, whose data is available in RDF dumps https://www.wikidata.org/wiki/Wikidata:RDF or at query.wikidata.org via SPARQL. For Oygen entity in Wikidata, or rather their page about it, see https://www.wikidata.org/wiki/Q629 - chemical symbol (https://www.wikidata.org/wiki/Property:P246) = O - atomic number (https://www.wikidata.org/wiki/Property:P1086) = 8 - mass (https://www.wikidata.org/wiki/Property:P2067) = 15.999 dalton - electronegativity (https://www.wikidata.org/wiki/Property:P1108) = 3.44 If you look around at Wikidata you'll see that some of these factual claims are sourced. So we can look into 15.999 being different to the 16 value in Hans-Jürgen's sketch. The sourcing given is: 19 October 2020 Atomic weights of the elements 2013 (IUPAC Technical Report) (English) Here is an example query that uses Wikidata SPARQL query service to pull out answers - i.e. Oxygen - with a chemical of 8. SELECT ?chem ?chemLabel ?atomicNumber ?mass ?electronegativity ?anyprop ?anyval WHERE { ?chem wdt:P246 ?chemSymbol; wdt:P1086 ?atomicNumber; wdt:P2067 ?mass; wdt:P1108 ?electronegativity; ?anyprop ?anyval . FILTER(?atomicNumber=8) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language } You can run it here: https://w.wiki/4q52 And back on the original theme about mapping, it is also worth knowing about the CONSTRUCT mechanism in SPARQL. We can take the above query and write CONSTRUCT queries that emit triples in a different shape or vocabulary. This is a SPARQL query that takes what's in Wikidata for all Chemicals and emits triples along the lines sketched initially: PREFIX foo: <https://foo.example.org/> CONSTRUCT { ?chem foo:symbol ?chemLabel . ?chem foo:numberOfElectrons ?atomicNumber . ?chem foo:atomicMass ?mass . ?chem foo:electronegativity ?electronegativity . ?chem foo:discoTime ?discoTime . # other properties from https://www.wikidata.org/wiki/Q629 here } WHERE { ?chem wdt:P246 ?chemSymbol; wdt:P1086 ?atomicNumber; wdt:P2067 ?mass; wdt:P1108 ?electronegativity . OPTIONAL { ?chem wdt:P575 ?discoTime . } . # commented out to get everything FILTER(?atomicNumber=8) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?discoTime # this might be pointless for CONSTRUCT queries Try it here: https://w.wiki/4q57 Hope this helps... Dan On Wed, 2 Feb 2022 at 11:31, Chet Ensign <chet.ensign@o...> wrote:
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



