BEXIS2 / Core

This is the public code repository of the BEXIS2 data management software. It contains only modules, components, and packages of the core system. Contributed modules and components will be available in separate repositories. For more information on BEXIS2, please visit our website.
https://bexis2.github.io/
17 stars 13 forks source link

Improved access to metadata information (Title & Description) #498

Closed DavidBlaa closed 4 years ago

DavidBlaa commented 4 years ago

Currently information like title and description ... are always loaded directly from the metadata xml from the database.

We need improved access to this information.

Maybe the information (extensible) is kept in a separate table or index

geofranzi commented 4 years ago

Wenn wir die Spalten an die Dataset version anhängen könnten man die mit einem Trigger automatisch befüllen, dazu müsste man als VAR dann die dv.id einsetzen.

Select (xpath('//' || (SELECT
  (xpath('//nodeRef/@value',xml_element))[1] AS "value"
FROM (
  SELECT unnest(xpath('//nodeReferences',m.extra)) AS xml_element FROM datasetversions dv left join datasets ds  on ds.id = dv.datasetref left join metadatastructures m  on ds.metadatastructureref= m.id  where dv.id = 10
) t where (xpath('//nodeRef/@name',xml_element))[1]::varchar = 'title') || '/text()', metadata))[1] as "test"  From  datasetversions dv  where dv.id = 10
DavidBlaa commented 4 years ago

https://github.com/BEXIS2/Core/commit/c71352652df8156ddb731fb8ea5e79cd01ae8071

geofranzi commented 4 years ago

Some numbers for "Create Dataset" (BE): before: 30-40s after: 20s Loop GetDatasetLatestVersion(id) -> GetDatasetLatestVersions(ids): 6s

geofranzi commented 4 years ago

""Failed for execute the submitted native query. Reason: \u002742601: Syntaxfehler bei »)«\u0027"" (Save metadata structure)