Skip to content

cybermaggedon/partygate-rdf

Repository files navigation

PartyGateRDF - PartyGate tools for linked-data scientists

If you love this project, you can buy ownership on OpenSea

Introduction

This is a data set containing references to information published by the media regarding the Partygate parties held by the government of the UK.

The information has all been gleaned from published information from the media, and no claims are made about the accuracy of the information in this dataset. The dataset contains links to some published reports for sourcing.

Demo

There is a demo which allows easy navigation of the data at SPARQL Sleuth. This is powered by the SPARQL Sleuth SPARQL navigator, and a SPARQL endpoint serving the data.

Here are some interesting entry points:

SPARQL endpoint

There is a SPARQL endpoint at https://partygate-sparql-prod-wrennwfy6q-ew.a.run.app which accepts SPARQL 1.0 queries against the data. Think of this as a way to run a query against the underlying data. There is no visualisation, the SPARQL endpoint is there to allow other applications to access the data. This endpoint can be queried from Python using sparqlwrapper, for instance.

Here are some example queries:

Information known about the Suitcase of Wine party

Query:

  SELECT DISTINCT * WHERE {<https://e623fd-partygate/suitcase-of-wine> ?prop ?value . }

See human-readable results

See raw results from the query

Parties which were known to be attended by Boris

Query:

  PREFIX pgp: <https://e623fd-partygate/p#>
  PREFIX pg: <https://e623fd-partygate/>
  PREFIX rdfs: <https://www.w3.org/2000/01/rdf-schema#>
  SELECT ?party
  WHERE {
    ?id rdfs:label ?party .
    ?id pgp:attended-by pg:boris-johnson .
  }

See human-readable results from this query

See raw results from this query

Parties attended by Boris which were reported to have broken a rule

Query:

  PREFIX pgp: <https://e623fd-partygate/p#>
  PREFIX pg: <https://e623fd-partygate/>
  PREFIX rdfs: <https://www.w3.org/2000/01/rdf-schema#>
   SELECT DISTINCT ?party ?breaks
   WHERE {
    ?a rdfs:label ?party .
    ?a pgp:contravenes ?d .
    ?d rdfs:label ?breaks .
    ?a pgp:attended-by pg:boris .
  }

See human-readable results from this query

See raw results from this query

Parties known to be held at Number 10

  PREFIX pgp: <https://e623fd-partygate/p#>
  PREFIX pg: <https://e623fd-partygate/>
  PREFIX rdfs: <https://www.w3.org/2000/01/rdf-schema#>
  SELECT ?party
  WHERE {
    ?id rdfs:label ?party .
    ?id pgp:location https://e623fd-partygate/no-10 .
  }

See human-readable results from this query

See raw results from this query

Underlying data

The dataset is a RDF triples. Apart from the 'type' and 'label' properties the dataset uses an internal ontology. RDFS types are contained within the dataset.

Object properties

Property Description
https://e623fd-partygate/p#attended-by Links a party to an attending person
https://e623fd-partygate/p#consumed Links a party to consumables
https://e623fd-partygate/p#context Links a party to another (possibly unrelated) newsworthy context
https://e623fd-partygate/p#contravenes Links a party to a rule which is reported to have been contravened
https://e623fd-partygate/p#date Links a party to a date
https://e623fd-partygate/p#invitations-sent Links a party to the person who invited attendees
https://e623fd-partygate/p#justification Links a party to a reported justification for the party
https://e623fd-partygate/p#location Links a party to its location
https://e623fd-partygate/p#quote Links a party to a quote in the media
https://e623fd-partygate/p#report Links a party to a media report
https://e623fd-partygate/p#weather Links a party to reported wather
https://dbpedia.org/ontolog/thumbnail Links to a thumbnail imag URL
https://purl.org/dc/elements/1.1/relation Links a report to the media articleURL
https://www.w3.org/1999/02/22-rdf-syntax-ns#type Links an object to its tpe
https://www.w3.org/2000/01/rdf-schema#label Links an object to a human-readable label

Object types

Type Description
https://e623fd-partygate/consumable Something which can be consumed at a party
https://e623fd-partygate/context A reported newsworthy context
https://e623fd-partygate/justification A justification
https://e623fd-partygate/location A location
https://e623fd-partygate/party A party
https://e623fd-partygate/person A person
https://e623fd-partygate/report A media report
https://e623fd-partygate/rule A restrictive policy, guidance or law
https://e623fd-partygate/weather A weather condition

Implementation / self-hosting

If you're curious about the implementation, the included Makefile contains data conversion and builds the demo, including the SPARQL endpoint.

The SPARQL endpoint is my project which is just an HTTP wrapper around the Redland library, which does all the SPARQL execution and triple-store management.

The serve.go code in this repository provides the web service and proxies out to the SPARQL service.

The Makefile builds two containers which are hosted on Docker hub:

The Makefile run target runs the containers if you need a hint as to how to run the containers.

Why?

As curious, crazy and contentious as this topic is, I'm a linked data developer, and turning complex information into navigable knowledge is fun.

Licence

Copyright © 2022 Cyberapocalypse Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

No claims are made as to the accuracy of this data.