zazuko / cube-creator

A tool to create RDF cubes from CSV files
GNU Affero General Public License v3.0
12 stars 2 forks source link

Adapt Links to Visualize from Publication View #1335

Closed l00mi closed 1 year ago

l00mi commented 1 year ago

Cube Creator - Prod -> https://visualize.admin.ch/en/browse?dataset=https%3A%2F%2Fenvironment.ld.admin.ch%2Ffoen%2Fubd010701%2F7

Cube Creator Int -> https://int.visualize.admin.ch/en/browse?dataset=https%3A%2F%2Fenvironment.ld.admin.ch%2Ffoen%2Fubd010701%2F7&dataSource=Int

Cube Creator Test -> https://int.visualize.admin.ch/en/browse?dataset=https%3A%2F%2Fenvironment.ld.admin.ch%2Ffoen%2Fubd010701%2F7&dataSource=Test

tpluscode commented 1 year ago

Three PRs to update the environment settings:

TEST: https://gitlab.ldbar.ch/vshn/gitops-main/-/merge_requests/87

INT: https://gitlab.ldbar.ch/vshn/gitops-main/-/merge_requests/86

PROD: https://gitlab.ldbar.ch/vshn/gitops-main/-/merge_requests/88

tpluscode commented 1 year ago

Board says "Closed"

Should I close here too @l00mi

l00mi commented 1 year ago

My open question would be, how difficult to correct, or simply remove all links from earlier runs? To avoid confusion and unnecessary bug reporting.

tpluscode commented 1 year ago

Should be fairly easy to run an update on existing jobs so that link to new URLs

tpluscode commented 1 year ago

This should do the job, when executed on cube-creator's database

prefix cc: <https://cube-creator.zazuko.com/vocab#>
prefix schema: <http://schema.org/>

DELETE {
  ?job schema:workExample ?workExample .
  ?workExample schema:url ?current ; ?p ?o .
}
INSERT {
  ?job schema:workExample ?newExample .
  ?newExample schema:url ?new ; ?p ?o .
}
WHERE {
  BIND ("" as ?visualize)
  BIND ("" as ?datasource)

  graph ?job {
    ?job a cc:PublishJob ;
         schema:workExample ?workExample ; 
         cc:project ?project .

    ?workExample schema:name "visualize.admin.ch"; 
                 schema:url ?current ;
                 ?p ?o .
  }

  graph ?project {
    ?project cc:dataset ?dataset .
  }

  graph ?dataset {
    ?dataset schema:hasPart ?rawCube
  }

  BIND(bnode(str(?job)) as ?newExample)
  BIND(IRI(CONCAT(?visualize, "en/browse?dataset=", ENCODE_FOR_URI(str(?rawCube)), ?datasource)) as ?new)

  SERVICE <> {
    ?rawCube schema:hasPart ?cube
  }
}

Fill in the BIND and SERVICE endpoint with values appropriate for each environment

ENV ?visualize ?datasource SERVICE
TEST https://int.visualize.admin.ch/ &dataSource=Test https://test.lindas.admin.ch/query
INT https://int.visualize.admin.ch/ &dataSource=Int https://int.lindas.admin.ch/query
PROD https://visualize.admin.ch/ (empty) https://lindas.admin.ch/query
tpluscode commented 1 year ago

That said, many of the generated links do not actually work in visualize. I have not checked why. Would it be missing actual data in Lindas? @l00mi

l00mi commented 1 year ago

That might be. I would to have check for some specific example.s

tpluscode commented 1 year ago

I think I see the mistake.

For example, this link generated on INT, as per @l00mi's initial comment used the domain int.visualize.admin.ch and parameter dataSource=Int. That fails to open

It works fine when changed to test.visualize.admin.ch.

In the case of TEST environment, the query would also be changed

ENV ?visualize ?datasource SERVICE
TEST https://test.visualize.admin.ch/ (empty) https://test.lindas.admin.ch/query

Here's an example:

https://test.visualize.admin.ch/en/browse?dataset=https%3A%2F%2Fculture.ld.admin.ch%2Fsfa%2FTest_Affenpocken_Datum

Can you confirm that's how it should be? @ptbrowne

tpluscode commented 1 year ago

I now updated all exiting jobs accordingly