Code Monkey home page Code Monkey logo

sparqldsl's Introduction

sparqldsl

A SPARQL DSL

Install

Development version

devtools::install_github("ropenscilabs/sparqldsl")
library("sparqldsl")

For examples we'll use DBpedia

ask

sparql_dsl("http://dbpedia.org/sparql") %>% ask(s, p, o)
#> [1] TRUE

select

sparql_dsl("http://dbpedia.org/sparql") %>%
  select() %>%
  where(s, p, o) %>%
  limit(10)
#>    s.type
#> 1     uri
#> 2     uri
#> 3     uri
#> 4     uri
#> 5     uri
#> 6     uri
#> 7     uri
#> 8     uri
#> 9     uri
#> 10    uri
#>                                                                         s.value
#> 1                    http://www.openlinksw.com/virtrdf-data-formats#default-iid
#> 2           http://www.openlinksw.com/virtrdf-data-formats#default-iid-nullable
#> 3           http://www.openlinksw.com/virtrdf-data-formats#default-iid-nonblank
#> 4  http://www.openlinksw.com/virtrdf-data-formats#default-iid-nonblank-nullable
#> 5                        http://www.openlinksw.com/virtrdf-data-formats#default
#> 6               http://www.openlinksw.com/virtrdf-data-formats#default-nullable
#> 7                    http://www.openlinksw.com/virtrdf-data-formats#sql-varchar
#> 8           http://www.openlinksw.com/virtrdf-data-formats#sql-varchar-nullable
#> 9                 http://www.openlinksw.com/virtrdf-data-formats#sql-varchar-dt
#> 10       http://www.openlinksw.com/virtrdf-data-formats#sql-varchar-dt-nullable
#>    p.type                                         p.value o.type
#> 1     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 2     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 3     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 4     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 5     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 6     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 7     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 8     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 9     uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#> 10    uri http://www.w3.org/1999/02/22-rdf-syntax-ns#type    uri
#>                                                    o.value
#> 1  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 2  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 3  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 4  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 5  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 6  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 7  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 8  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 9  http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
#> 10 http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat

Open citations methods

oc_doi2ids("10.1097/igc.0000000000000609")
#>    type                           value
#> 1 paper https://w3id.org/oc/corpus/br/1
#> 2  pmid                        26645990
#> 3 pmcid                      PMC4679344
#> 4   doi    10.1097/igc.0000000000000609
oc_pmid2ids("26645990")
#>    type                           value
#> 1 paper https://w3id.org/oc/corpus/br/1
#> 2   doi    10.1097/igc.0000000000000609
#> 3 pmcid                      PMC4679344
#> 4  pmid                        26645990
oc_pmcid2ids("PMC4679344")
#>    type                           value
#> 1 paper https://w3id.org/oc/corpus/br/1
#> 2   doi    10.1097/igc.0000000000000609
#> 3  pmid                        26645990
#> 4 pmcid                      PMC4679344

Meta

  • Please report any issues or bugs
  • License: MIT
  • Get citation information for sparqldsl in R doing citation(package = 'sparqldsl')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

sparqldsl's People

Contributors

sckott avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.