Knowledge Graph
Cellar
The CELLAR is the common repository of content managed by the Publications Office. It contains the files and the metadata of various collections of documents:
Cellar interface is publicly accessible. Cellar documentation provides information and examples on how to access content files and metadata from the Cellar. Though it is open to all citizens, this document is addressed mainly to developers and companies who want to automatize their access to legal documents and publications published by OP.
Â
Knowledge graph
Cellar metadata is stored in a knowledge graph, and more specifically in a triple store. A SPARQL interface is used to query the metadata.
Tools to query the knowledge graph
Users oriented tools
The Publications Office provides several tools that allow users to access directly the metadata or the publications stored in Cellar.
Linked Data query wizard available in OP Portal
The wizard guide users through several steps to create a Linked Data query:
- Select metadata to be displayed
- Define conditions
- Customize results
- Execute query
Through the Advanced SPARQL Query Editor available in portal
The EU Law and Publications Portal (http://op.europa.eu) allows end users to access collections through the the Flint SPARQL editor.
Using directly the Cellar SPARQL interface
The SPARQL interface of Cellar is accessible on https://publications.europa.eu/webapi/rdf/sparql.
The SPARQL interface allows to query Cellar metadata with SPARQL language thanks to the Common Metadata Model (CDM).
Extracting publications and metadata from Cellar
The complete metadata associated with a work can be extracted in XML or RDF format using the Cellar dissemination RESTFul interface. More details are given in the metadata page. SPARQL queries can also be used for this purpose. You can customize your SPARQL query depending of what you want. This section give you some concrete examples.
On the client applications, specific processing logic must be implemented to link work, expressions and manifestations based on the relations and values from XML.
The same information can be obtained using SPARQL and cellar SPARQL interface (https://publications.europa.eu/webapi/rdf/sparql). This SPARQL query retrieves work Cellar Id, expression Cellar Id, manifestation Cellar Id, item Cellar Id, language code and format. The URLs from ?item column of the result set represent the download links.
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix purl: <http://purl.org/dc/elements/1.1/> select distinct ?work, ?expr, ?manif, ?langCode, str(?format) as ?format, ?item where { ?work owl:sameAs <http://publications.europa.eu/resource/celex/32018R1805> . ?expr cdm:expression_belongs_to_work ?work ; cdm:expression_uses_language ?lang . ?lang purl:identifier ?langCode . ?manif cdm:manifestation_manifests_expression ?expr; cdm:manifestation_type ?format. ?item cdm:item_belongs_to_manifestation ?manif. } LIMIT 1000 |
You can also retrieve a WEMI hierarchy with language filter in order to retrieve the expression, the manifestations and the items of this specific language.
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix purl: <http://purl.org/dc/elements/1.1/> select distinct ?work, ?expr, ?manif, ?langCode, str(?format) as ?format, ?item where { ?work owl:sameAs <http://publications.europa.eu/resource/celex/32018R1805> . ?expr cdm:expression_belongs_to_work ?work ; cdm:expression_uses_language ?lang . ?lang purl:identifier ?langCode . ?manif cdm:manifestation_manifests_expression ?expr; cdm:manifestation_type ?format. ?item cdm:item_belongs_to_manifestation ?manif. FILTER(str(?langCode)="ENG") } LIMIT 1000 |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?uri ?businessIdentifier WHERE { ?uri cdm:official-journal_year "2022"^^xsd:gYear. ?uri rdf:type cdm:official-journal. ?uri owl:sameAs ?businessIdentifier . } |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?uri ?ojclass ?ojnumber ?ojcollection ?ojyear ?workdatedoc WHERE { ?uri cdm:official-journal_class ?ojclass . ?uri cdm:official-journal_number ?ojnumber . ?uri cdm:official-journal_part_of_collection_document ?ojcollection . ?uri cdm:official-journal_year ?ojyear . ?uri cdm:work_date_document ?workdatedoc . ?uri rdf:type cdm:official-journal . FILTER( ?workdatedoc >= "2022-01-01"^^xsd:date && ?workdatedoc < "2022-10-01"^^xsd:date) } |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> select distinct ?w ?class ?ecli ?title ?agent where { ?w a ?class. ?w cdm:date_creation_legacy ?datedoc. OPTIONAL{?w cdm:case-law_ecli ?ecli.} OPTIONAL{?e cdm:expression_belongs_to_work ?w. ?e cdm:expression_uses_language <http://publications.europa.eu/resource/authority/language/ENG>. ?e cdm:expression_title ?title. ?w cdm:work_created_by_agent ?agent . } FILTER( ?datedoc >= "2022-01-01"^^xsd:date && ?datedoc < "2022-12-01"^^xsd:date) FILTER(?class in (<http://publications.europa.eu/ontology/cdm#document_cjeu>, <http://publications.europa.eu/ontology/cdm#court-report>, <http://publications.europa.eu/ontology/cdm#case-law>, <http://publications.europa.eu/ontology/cdm#summary_case-law>, <http://publications.europa.eu/ontology/cdm#summary_case-law_jure>)) } ORDER BY ?class |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> select ?uri, ?legalYear, ?dateDocument, group_concat(?agent,',') as ?agents, group_concat(?sameAs,',') as ?otherUris, ?legalType where { ?uri cdm:work_date_document ?workdatedoc . ?uri rdf:type cdm:act_preparatory . ?uri owl:sameAs ?sameAs; cdm:resource_legal_type ?legalType; cdm:resource_legal_year ?legalYear; cdm:work_date_document ?dateDocument; cdm:work_created_by_agent ?agent . FILTER( ?workdatedoc >= "2022-01-01"^^xsd:date && ?workdatedoc < "2022-04-01"^^xsd:date) } |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> select ?act, ?date_entry_into_force, GROUP_CONCAT (?actID,',') as ?actIds where { ?act cdm:resource_legal_in-force "true"^^<http://www.w3.org/2001/XMLSchema#boolean>. ?act cdm:resource_legal_date_entry-into-force ?date_entry_into_force. ?act cdm:work_id_document ?actID FILTER( ?date_entry_into_force>= "2022-01-01"^^xsd:date && ?date_entry_into_force< "2023-01-01"^^xsd:date) } order by ?date_entry_into_force |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> select ?case ?dossier_identifier ?dossier_title group_concat(?event,',') as ?events ?number_reference ?domain ?case_status ?court_identifier_court ?court_identifier_extension ?court_identifier_extension_number ?court_identifier_number ?court_identifier_year group_concat(?work,',') as ?works ?year_reference group_concat(?sameAs,',') as ?sameAs where { ?case a cdm:case_court. ?event cdm:event_part_of_dossier ?case. ?case cdm:dossier_identifier ?dossier_identifier. ?case cdm:dossier_title ?dossier_title. OPTIONAL{?case cdm:dossier_number_reference ?number_reference.} OPTIONAL{?case cdm:case_court_domain ?domain.} OPTIONAL{?case cdm:case_court_has_case-status ?case_status.} OPTIONAL{?case cdm:case_court_identifier_court ?court_identifier_court.} OPTIONAL{?case cdm:case_court_identifier_extension ?court_identifier_extension.} OPTIONAL{?case cdm:case_court_identifier_extension_number ?court_identifier_extension_number.} OPTIONAL{?case cdm:case_court_identifier_number ?court_identifier_number.} OPTIONAL{?case cdm:case_court_identifier_year ?court_identifier_year.} OPTIONAL{?case cdm:dossier_contains_work ?work} OPTIONAL{?case cdm:dossier_year_reference ?year_reference.} ?case owl:sameAs ?sameAs. } order by ?case limit 1000 |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix skos: <http://www.w3.org/2004/02/skos/core#> select distinct ?concept ?label where { ?concept skos:inScheme ?scheme . values(?scheme){(<http://publications.europa.eu/resource/authority/corporate-body>)} ?concept skos:prefLabel ?label FILTER (lang(?label ) = 'en') } |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix dc: <http://purl.org/dc/elements/1.1/> select distinct ?concept ?identifier ?preflabel ?altlabel GROUP_CONCAT(DISTINCT ?broader; separator=";\r\n") AS ?broaders GROUP_CONCAT(DISTINCT ?narrower; separator=";\r\n") AS ?narrowers GROUP_CONCAT(DISTINCT ?isTopConceptOf; separator=";\r\n") AS ?isTopConceptOfs GROUP_CONCAT(DISTINCT ?related; separator=";\r\n") AS ?relateds where { graph <http://eurovoc.europa.eu/100141> { ?concept skos:prefLabel ?preflabel. FILTER (lang(?preflabel ) = 'en') OPTIONAL{ ?concept skos:altLabel ?altlabel. FILTER (lang(?altlabel ) = 'en'). } OPTIONAL{ {?concept skos:broader ?broader.} UNION {?broader skos:narrower ?concept.} } OPTIONAL{ {?concept skos:narrower ?narrower.} UNION {?narrower skos:broader ?concept.} } OPTIONAL{?concept skos:topConceptOf ?isTopConceptOf.} OPTIONAL{ {?concept skos:related ?related.} UNION{?related skos:related ?concept.} } ?concept dc:identifier ?identifier. } } |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix dc: <http://purl.org/dc/elements/1.1/> select distinct ?concept ?identifier ?preflabel GROUP_CONCAT(DISTINCT ?broaderWithPref; separator=";\r\n") AS ?broaders GROUP_CONCAT(DISTINCT ?narrowerWithPref; separator=";\r\n") AS ?narrowers where { graph <http://publications.europa.eu/resource/authority/dir-eu-legal-act> { ?concept skos:prefLabel ?preflabel. #FILTER (lang(?preflabel ) = 'en') OPTIONAL{ {?concept skos:broader ?broader.} UNION {?broader skos:narrower ?concept.} ?broader skos:prefLabel ?preflabelBroader. FILTER (lang(?preflabelBroader)=lang(?preflabel) ). BIND (CONCAT(?broader, " (", ?preflabelBroader, ")")AS ?broaderWithPref) } OPTIONAL{ {?concept skos:narrower ?narrower.} UNION {?narrower skos:broader ?concept.} ?narrower skos:prefLabel ?preflabelNarrower. FILTER (lang(?preflabelNarrower)=lang(?preflabel) ). BIND (CONCAT(?narrower, " (", ?preflabelNarrower, ")")AS ?narrowerWithPref) } ?concept dc:identifier ?identifier. } } |
prefix cdm: <http://publications.europa.eu/ontology/cdm#> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix dc: <http://purl.org/dc/elements/1.1/> select distinct ?concept ?identifier ?preflabel GROUP_CONCAT(DISTINCT ?broaderWithPref; separator=";\r\n") AS ?broaders GROUP_CONCAT(DISTINCT ?narrowerWithPref; separator=";\r\n") AS ?narrowers where { graph <http://publications.europa.eu/resource/authority/subject-matter> { ?concept skos:prefLabel ?preflabel. #FILTER (lang(?preflabel ) = 'en') OPTIONAL{ {?concept skos:broader ?broader.} UNION {?broader skos:narrower ?concept.} ?broader skos:prefLabel ?preflabelBroader. FILTER (lang(?preflabelBroader)=lang(?preflabel) ). BIND (CONCAT(?broader, " (", ?preflabelBroader, ")")AS ?broaderWithPref) } OPTIONAL{ {?concept skos:narrower ?narrower.} UNION {?narrower skos:broader ?concept.} ?narrower skos:prefLabel ?preflabelNarrower. FILTER (lang(?preflabelNarrower)=lang(?preflabel) ). BIND (CONCAT(?narrower, " (", ?preflabelNarrower, ")")AS ?narrowerWithPref) } ?concept dc:identifier ?identifier. } } |
prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix euvoc: <http://publications.europa.eu/ontology/euvoc#> prefix org: <http://www.w3.org/ns/org#> prefix vcard: <http://www.w3.org/2006/vcard/ns#> prefix person: <http://publications.europa.eu/resource/person> SELECT DISTINCT * where { ?per a foaf:Person. ?per foaf:name ?name . ?per foaf:givenName ?givenName . ?per vcard:hasGender ?gender . ?per foaf:familyName ?familyName . ?per org:hasMembership ?membership. ?per vcard:hasHonorificPrefix ?honorificPrefix . ?membership euvoc:positionComplement ?position . ?membership org:organization ?org . ?org skos:prefLabel ?label . FILTER (str(?familyName) = 'HARDEMAN' && str(?givenName) = 'Hilde') FILTER (lang(?position) = 'en' && lang(?label) = 'en') } |