SIOC Post profile for "AI3:::Adaptive Information"
type: Document
description: A SIOC profile describes the structure and contents of a weblog in a machine readable form. For more information please refer to http://sioc-project.org/.
primary topic: CWPK #50: Querying External Sources
generator agent: http://rdfs.org/sioc/wp-sioc.php

CWPK #50: Querying External Sources
type: Post
has container: weblog
has creator: Mike Bergman
maker: Mike Bergman
created: 2020-10-08T15:00:31Z
content: The Nearly Infinite Usefulness of SPARQL We are now two-thirds of the way through our CWPK series. One reason we have emphasized 'roundtripping' in Cooking with Python and KBpedia is to accommodate the incorporation of information from external sources into KBpedia. From hierarchical relationships to annotations like definitions or labels, external sources can be essential. Of course, one can find flat files or spreadsheets or CSV files directly, but often times we need specific information that can only come from querying the external source directly. Two of the ones we heavily rely on in particular -- Wikidata and DBpedia -- provide this access through SPARQL queries. We first introduced SPARQL in CWPK #25. External SPARQL queries are the basis of getting instance data, values for instance attributes, missing fields like altLabels and skos.definition, existing crosswalks or mappings, longer descriptions, subsumption relations, related links, and interesting joins and intersections across external knowledge base content. Often, one is able to specify the format (serialization) of the desired results. The outputs from these external queries can be manipulated as strings, and then written to flat files useful for ingest into the various build routines. Of course, it is important that the format and CSV-nature of the results be maintained in a form that the build routines expect. One may alter the build formats or the extract formats, but to work they need to match on both ends. So, what we provide in today's installment are some guidelines and recipes for using SPARQL to obtain information you need and to write them to flat files. Because of their importance, we emphasize Wikidata and DBpedia (also a stand-in for Wikipedia) in our examples. Once populated, you may need to do some intermediate wrangling of these files to get them into shape for direct import. We covered that topic in brief in CWPK #36, but really do not address file wrangling further here. There are w…
encoded: The Nearly Infinite Usefulness of SPARQL We are now two-thirds of the way through our CWPK series. One reason we have emphasized ‘roundtripping‘ in Cooking with Python and KBpedia is to accommodate the incorporation of information from external sources into KBpedia. From hierarchical relationships to annotations like definitions or labels, external sources can be essential. Of course, one can find flat files or spreadsheets or CSV files directly, but often times we need specific information that can only come from querying the external source directly. Two of the ones we heavily rely on in particular — Wikidata and DBpedia — provide this access through SPARQL queries. We first introduced SPARQL in CWPK #25. External SPARQL queries are the basis of getting instance data, values for instance attributes, missing fields like altLabels and skos.definition, existing crosswalks or mappings, longer descriptions, subsumption relations, related links, and interesting joins and intersections across external knowledge base content. Often, one is able to specify the format (serialization) of the desired results. The outputs from these external queries can be manipulated as strings, and then written to flat files useful for ingest into the various build routines. Of course, it is important that the format and CSV-nature of the results be maintained in a form that the build routines expect. One may alter the build formats or the extract formats, but to work they need to match on both ends. So, what we provide in today’s installment are some guidelines and recipes for using SPARQL to obtain information you need and to write them to flat files. Because of their importance, we emphasize Wikidata and DBpedia (also a stand-in for Wikipedia) in our examples. Once populated, you may need to do some intermediate wrangling of these files to get them into shape for direct import. We covered that topic in brief in CWPK #36, but really do not address file wrangling further here. There are way…
topic: CWPK
topic: KBpedia
topic: Semantic Web Tools
links to: roundtripping
links to: Cooking with Python and KBpedia
links to: KBpedia
links to: CSV
links to: Wikidata
links to: DBpedia
links to: SPARQL
links to: CWPK #25
links to: wrangling
links to: CWPK #36
links to: linked open data
links to: LOD endpoint maintained
links to: cb1-1
links to: cb1-2
links to: cb1-3
links to: cb2-1
links to: cb2-2
links to: cb2-3
links to: cb2-4
links to: cb2-5
links to: cb2-6
links to: cb3-1
links to: cb3-2
links to: cb3-3
links to: cb3-4
links to: cb3-5
links to: cb3-6
links to: cb3-7
links to: cb3-8
links to: cb3-9
links to: cb3-10
links to: cb3-11
links to: cb3-12
links to: cb4-1
links to: cb4-2
links to: cb4-3
links to: cb4-4
links to: Try it!
links to: cb5-1
links to: cb5-2
links to: cb5-3
links to: cb5-4
links to: cb5-5
links to: cb5-6
links to: cb5-7
links to: cb5-8
links to: cb5-9
links to: cb5-10
links to: cb5-11
links to: cb5-12
links to: cb5-13
links to: cb5-14
links to: cb5-15
links to: cb5-16
links to: cb5-17
links to: cb5-18
links to: cb5-19
links to: cb5-20
links to: cb5-21
links to: cb6-1
links to: cb6-2
links to: cb6-3
links to: cb6-4
links to: cb6-5
links to: cb6-6
links to: cb6-7
links to: cb6-8

Mike Bergman
type: User

Mike Bergman
type: Person

Cooking with Python and KBpedia
label: CWPK listing

Try it!

Try it!

Try it!

Try it!

Try it!

Try it!

Try it!

Try it!

Try it!

Try it!

OpenStreetMap

KBpedia

code listing covering the series

direct download

notify me