Closed vhf closed 4 years ago
API:
const entryPoint = new DataCubeEntryPoint( "https://trifid-lindas.test.cluster.ldbar.ch/query", { languages: ["fr", "de"], extraMetadata: [ { variable: "contact", iri: "https://pcaxis.described.at/contact", multilang: true }, { variable: "source", iri: "https://pcaxis.described.at/source", multilang: true }, { variable: "survey", iri: "https://pcaxis.described.at/survey", multilang: true }, { variable: "database", iri: "https://pcaxis.described.at/database", multilang: true }, { variable: "unit", iri: "https://pcaxis.described.at/unit", multilang: true }, { variable: "note", iri: "https://pcaxis.described.at/note", multilang: true }, { variable: "dateCreated", iri: "http://schema.org/dateCreated", multilang: false }, { variable: "dateModified", iri: "http://schema.org/dateModified", multilang: false }, { variable: "temporalCoverage", iri: "http://schema.org/temporalCoverage", multilang: true }, { variable: "description", iri: "http://www.w3.org/2000/01/rdf-schema#comment", multilang: true }, ], }, );
Resulting SPARQL:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX qb: <http://purl.org/linked-data/cube#> PREFIX dc11: <http://purl.org/dc/elements/1.1/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?iri ?graphIri ?label ?contact ?source ?survey ?database ?unit ?note ?dateCreated ?dateModified ?temporalCoverage ?description WHERE { GRAPH ?graphIri { ?iri rdf:type qb:DataSet. OPTIONAL { ?iri (rdfs:label|skos:prefLabel) ?label_fr. FILTER(LANGMATCHES(LANG(?label_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri (rdfs:label|skos:prefLabel) ?label_de. FILTER(LANGMATCHES(LANG(?label_de), "de"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/contact> ?contact_fr. FILTER(LANGMATCHES(LANG(?contact_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/contact> ?contact_de. FILTER(LANGMATCHES(LANG(?contact_de), "de"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/source> ?source_fr. FILTER(LANGMATCHES(LANG(?source_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/source> ?source_de. FILTER(LANGMATCHES(LANG(?source_de), "de"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/survey> ?survey_fr. FILTER(LANGMATCHES(LANG(?survey_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/survey> ?survey_de. FILTER(LANGMATCHES(LANG(?survey_de), "de"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/database> ?database_fr. FILTER(LANGMATCHES(LANG(?database_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/database> ?database_de. FILTER(LANGMATCHES(LANG(?database_de), "de"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/unit> ?unit_fr. FILTER(LANGMATCHES(LANG(?unit_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/unit> ?unit_de. FILTER(LANGMATCHES(LANG(?unit_de), "de"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/note> ?note_fr. FILTER(LANGMATCHES(LANG(?note_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri <https://pcaxis.described.at/note> ?note_de. FILTER(LANGMATCHES(LANG(?note_de), "de"^^xsd:string)) } OPTIONAL { ?iri <http://schema.org/dateCreated> ?dateCreated. } OPTIONAL { ?iri <http://schema.org/dateModified> ?dateModified. } OPTIONAL { ?iri <http://schema.org/temporalCoverage> ?temporalCoverage_fr. FILTER(LANGMATCHES(LANG(?temporalCoverage_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri <http://schema.org/temporalCoverage> ?temporalCoverage_de. FILTER(LANGMATCHES(LANG(?temporalCoverage_de), "de"^^xsd:string)) } OPTIONAL { ?iri rdfs:comment ?description_fr. FILTER(LANGMATCHES(LANG(?description_fr), "fr"^^xsd:string)) } OPTIONAL { ?iri rdfs:comment ?description_de. FILTER(LANGMATCHES(LANG(?description_de), "de"^^xsd:string)) } } BIND(COALESCE(?label_fr, ?label_de, ""^^xsd:string) AS ?label) BIND(COALESCE(?contact_fr, ?contact_de, ""^^xsd:string) AS ?contact) BIND(COALESCE(?source_fr, ?source_de, ""^^xsd:string) AS ?source) BIND(COALESCE(?survey_fr, ?survey_de, ""^^xsd:string) AS ?survey) BIND(COALESCE(?database_fr, ?database_de, ""^^xsd:string) AS ?database) BIND(COALESCE(?unit_fr, ?unit_de, ""^^xsd:string) AS ?unit) BIND(COALESCE(?note_fr, ?note_de, ""^^xsd:string) AS ?note) BIND(COALESCE(?temporalCoverage_fr, ?temporalCoverage_de, ""^^xsd:string) AS ?temporalCoverage) BIND(COALESCE(?description_fr, ?description_de, ""^^xsd:string) AS ?description) }
TODO:
lastModified
related to #16
API:
Resulting SPARQL:
TODO:
lastModified
related to #16