SPARQL

Querying Semantic Data

SPARQL (pronounced “sparkle”, a recursive acronym for SPARQL Protocol and RDF Query Language) is an RDF query language, that is, a query language for databases, able to retrieve and manipulate data stored in Resource Description Framework format. RDF is commonly used for modeling information in the web of linked data.

It was made a standard by the RDF Data Access Working Group (DAWG) of the World Wide Web Consortium, and is considered as one of the key technologies of the semantic web. On 15 January 2008, SPARQL 1.0 became an official W3C Recommendation.

Querying WordLift’s Data with SPARQL – a Cheat Sheet

Here we have listed few queries in SPARQL created to extract metadata being shared as linked data by semantic websites that use WordLift.

1. What are the most recurring concepts used on the site to mark up the articles?

PREFIX dct: <http://purl.org/dc/terms/>
SELECT * WHERE {
SELECT ?o (COUNT() as ?count) WHERE { [] dct:references ?o }
GROUP BY
?o
} ORDER BY DESC(?count) LIMIT 10

2. What are the most recurring concepts taking into account the relationships created among concepts?

PREFIX dct: <http://purl.org/dc/terms/>
SELECT * WHERE {
SELECT ?o (COUNT() as ?count) WHERE { [] dct:relation ?o }
GROUP BY
?o
} ORDER BY DESC(?count) LIMIT 10

3. What are the most recurring concepts combining the relationships with articles and the relationships among entities?

PREFIX dct: <http://purl.org/dc/terms/>
SELECT * WHERE {
SELECT ?o (COUNT() as ?count) WHERE { { [] dct:references ?o } UNION { [] dct:relation ?o } }
GROUP BY
?o
} ORDER BY DESC(?count) LIMIT 10

4. How many triples have been created on the site?

SELECT (COUNT() AS ?no) { ?s ?p ?o }

5. How many entities have been created on the site?

SELECT (COUNT(distinct ?s) AS ?no) { ?s a [] }

6. How many articles have been annotated with WordLift?

SELECT (COUNT(distinct ?s) AS ?no) WHERE {?s a <http://schema.org/BlogPosting> . }

Must Read Content

Why Do We Need Knowledge Graphs?
Learn what a knowledge graph brings to SEO with Teodora Petkova

2x Your Video SEO in 3 Simple Steps
Use videos to increase traffic to your websites

SEO Automation in 2021
Improve the SEO of your website through Artificial Intelligence

The Power of Product Knowledge Graph for E-commerce
Dive deep into the power of data for e-commerce

Touch your SEO: Introducing Physical SEO
Connect a physical product to the ecosystem of data on the web

Are you ready for the new SEO?
Try WordLift now!




Learn how to use structured data to get better SEO rankings. Practical SEO tips, webinars, and case studies right in your inbox once a week.

Learn how to use structured data to get better SEO rankings. Practical SEO tips, webinars, and case studies right in your inbox once a week.

Congrats you are in!

Stand out on search in 2019. Get 50% off WordLift until January 7th Buy Now!

x