Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example using DBpedia SPARQL Endpoint #11

Open
kidehen opened this issue May 14, 2021 · 0 comments
Open

Example using DBpedia SPARQL Endpoint #11

kidehen opened this issue May 14, 2021 · 0 comments

Comments

@kidehen
Copy link

kidehen commented May 14, 2021

Wondering anyone could make an example using DBpedia via its SPARQL endpoint?

Here is a SPARQL CONSTRUCT Query example that could be used to create the GraphQL mapping file.

PREFIX : <https://github.com/dbcls/grasp/ns/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX db: <http://purl.jp/bio/03/dbcatalog/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/resource/> 
PREFIX dbp: <http://dbpedia.org/property/> 

CONSTRUCT {
                ?iri :iri ?iri ;
                    rdfs:label ?title ;
                    dbp:author ?author . 
                ?author rdfs:label ?authorName . 
         }

WHERE
{
    ?iri a schema:Book ;
            rdfs:label ?title ;
            dbp:author ?author . 
    FILTER (LANG(?title) = 'en')

    ?author rdfs:label ?authorName . 
    FILTER (LANG(?authorName) = 'en')
}

Live Query Results Page Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant