Skip to content
Snippets Groups Projects
Commit 8c4272d3 authored by Mathieu Massaviol's avatar Mathieu Massaviol
Browse files

Fix publisher reloading #35

parent fe5500c2
Branches
No related tags found
1 merge request!81Resolve "Créer un catalogue"
Pipeline #10867 failed
......@@ -246,7 +246,7 @@ export async function updateCatalog(catalog: OcCatalog, profile: OcPerson, auth?
OPTIONAL {
<${catalog['@id']}> dct:temporal ?temporal.
?temporal ?p2 ?o2.
filter isblank(?temporal)
FILTER isblank(?temporal)
}
<${catalog['@id']}> ?p ?o.
};
......@@ -388,8 +388,8 @@ export async function getCatalog(identifier: string, auth?: Credentials): Promis
}
WHERE {
<${catalogUri}> dct:creator ?creator.
VALUES ?p1 { rdf:type foaf:familyName foaf:name foaf:givenName foaf:firstName foaf:lastName foaf:mbox }
?creator ?p1 ?o1.
FILTER (?p1 IN (rdf:type, foaf:familyName, foaf:name, foaf:givenName, foaf:firstName, foaf:lastName, foaf:mbox))
}
`,
{
......@@ -407,8 +407,8 @@ export async function getCatalog(identifier: string, auth?: Credentials): Promis
}
WHERE {
<${catalogUri}> dcat:contactPoint ?contactPoint.
VALUES ?p1 { rdf:type foaf:familyName foaf:name foaf:givenName foaf:firstName foaf:lastName foaf:mbox }
?contactPoint ?p1 ?o1.
FILTER (?p1 IN (rdf:type, foaf:familyName, foaf:name, foaf:givenName, foaf:firstName, foaf:lastName, foaf:mbox))
}
`,
{
......@@ -551,6 +551,26 @@ export async function getCatalog(identifier: string, auth?: Credentials): Promis
}
)
/**
* Publisher
*/
const catalogPublisherPromise = executeSparqlConstruct<OcOrganization>(
`
CONSTRUCT {
?publisher ?p ?o.
}
WHERE {
<${catalogUri}> dct:publisher ?publisher.
VALUES ?p { dct:identifier rdf:type dct:title dct:description foaf:name }
?publisher ?p ?o.
}
`,
{
auth,
context: resourceContext
}
)
const catalogResponse = await Promise.all([
catalogTemporalPromise, // 0
catalogStatusPromise, // 1
......@@ -561,7 +581,8 @@ export async function getCatalog(identifier: string, auth?: Credentials): Promis
catalogLanguagePromise, // 6
catalogTypePromise, // 7
catalogSubsPromise, // 8
catalogDatasetsPromise // 9
catalogDatasetsPromise, // 9
catalogPublisherPromise // 10
])
catalog.temporal = catalogResponse[0].map<[Date, Date]>((temporal) => [
......@@ -577,6 +598,7 @@ export async function getCatalog(identifier: string, auth?: Credentials): Promis
catalog.type = catalogResponse[7][0]
catalog.catalogs = catalogResponse[8]
catalog.datasets = catalogResponse[9]
catalog.publisher = catalogResponse[10][0]
return catalog
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment