dbpedia / databus

A digital factory platform for managing files online with stable IDs, high-quality metadata, powerful API and tools for building on data: find, access, make interoperable, re-use
Apache License 2.0
36 stars 16 forks source link

No possibility to see original link of artifacts #47

Closed henhuy closed 1 year ago

henhuy commented 1 year ago

I uploaded several artifacts to the databus and at least for one artifact, I forgot what URL I used to submit data to the databus. When hovering download button of artifact, I only can see the internal link which is handled by the databus itself, but not the link behind which points to the original source. Could not find it anywhere. This would be a nice feature!

Example: https://energy.databus.dbpedia.org/felixmaur/modex/modex_tech_wind_turbine_onshore/v6 Hovering download button of "data" artifact points to https://energy.databus.dbpedia.org/felixmaur/modex/modex_tech_wind_turbine_onshore/v6/modex_tech_wind_turbine_onshore_type=data.csv But I want an information about original source which would point to the OEP.

kurzum commented 1 year ago

Hi @henhuy, we did the URL masking to 1. track downloads, 2. have canoncial URIs for files and 3. to implement ACL / permissions later.

We will eventually include it in the UI to view the link, but I guess this will a later version, e.g. 2.3+

At the moment, you can get the download url via:

curl https://energy.databus.dbpedia.org/felixmaur/modex/modex_tech_wind_turbine_onshore/v6/modex_tech_wind_turbine_onshore_type=data.csv

resulting in:

Temporary Redirect. Redirecting to https://openenergy-platform.org/api/v0/schema/model_draft/tables/modex_tech_wind_turbine_onshore/rows?form=csv&where=version=v6

alternatively, you can use the web developer tool in the browser: Screenshot from 2023-04-03 16-23-36 Screenshot from 2023-04-03 16-22-15

kurzum commented 1 year ago

@kurzum test how the 2.1.0 version actually implements it.

holycrab13 commented 1 year ago

UI masking is still a thing in 2.1.0, but tracking (i.e. counts) is not explicitly done in the Databus. This can be done via access logs though.

The full metadata document of a Databus Version can be accessed via SPARQL query or by curling for any other format than HTML

e.g.

curl -H "Accept: application/ld+json"  https://energy.databus.dbpedia.org/felixmaur/modex/modex_tech_wind_turbine_onshore/v6

The returned JSONLD will contain the downloadURLs.

Alternatively, a SPARQL query against https://energy.databus.dbpedia.org/sparql can do the trick:

PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcat:   <http://www.w3.org/ns/dcat#>
PREFIX dct:    <http://purl.org/dc/terms/>
PREFIX dcv: <http://dataid.dbpedia.org/ns/cv#>
PREFIX dataid: <http://dataid.dbpedia.org/ns/core#>

SELECT ?file  ?downloadURL WHERE
{
    GRAPH ?g
    {
        ?dataset dataid:artifact <https://energy.databus.dbpedia.org/felixmaur/modex/modex_tech_wind_turbine_onshore> .
        { ?distribution <http://purl.org/dc/terms/hasVersion> 'v6' . }
        ?dataset dcat:distribution ?distribution .
        ?distribution dataid:file ?file .
                ?distribution dcat:downloadURL ?downloadURL .
    }
}

I took the query from the "Query" tab of the file browser on the version page (https://energy.databus.dbpedia.org/felixmaur/modex/modex_tech_wind_turbine_onshore/v6) and modified it to include the download URL.

If this turns out to be a very frequent user activity, we can consider adding this to the GUI at a later stage.