Skip to content

Commit

Permalink
accessres fixed with the new vocabs
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Jun 26, 2020
1 parent b19fa3b commit 5536aad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions inst/dbfunctions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ CREATE TEMP TABLE accessres AS (
from relations as r
left join metadata_view as mv on mv.id = r.target_id
where r.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasAccessRestriction'
and mv.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle' and mv.value like 'http%'
and mv.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle'
) select * from acs
);
/* get only the collection resource and the parent id and also the depth to we can build up the tree view */
Expand Down Expand Up @@ -232,6 +232,7 @@ LANGUAGE 'plpgsql';
* _page = for paging, first page is 0
* _orderby = the ordering property -> https://vocabs.acdh.oeaw.ac.at/schema#hasTitle
* _lang = 'en' or 'de'
* select * from gui.child_views_func('https://repo.hephaistos.arz.oeaw.ac.at/api/8145', '10', '0', 'desc', 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle', 'en', ARRAY [ 'https://vocabs.acdh.oeaw.ac.at/schema#isPartOf' ])
*/
CREATE OR REPLACE FUNCTION gui.child_views_func(_parentid text, _limit text, _page text, _orderby text, _orderprop text, _lang text DEFAULT 'en', _rdftype text[] DEFAULT '{}' )
RETURNS table (id bigint, title text, avDate timestamp, description text, accesres text, titleimage text, acdhtype text)
Expand Down Expand Up @@ -260,7 +261,7 @@ DROP TABLE IF EXISTS child_ids;
(select mv.value from metadata_view as mv where mv.id = r.id and mv.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasDescription' and mv.lang = _lang2 limit 1)
) description,
(select mv.value from relations as r2 left join metadata_view as mv on r2.target_id = mv.id where r.id = r2.id and r2.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasAccessRestriction' and
mv.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle' and value like 'http%') as accessres,
mv.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle' and mv.lang = _lang) as accessres,
(select mv.value from metadata_view as mv where r.id = mv.id and mv.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitleImage' limit 1) as titleimage,
(select mv.value from metadata_view as mv where r.id = mv.id and mv.property = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' and mv.value like '%vocabs.%' limit 1) as acdhtype
from relations as r
Expand Down
1 change: 0 additions & 1 deletion src/Model/ChildApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public function getViewData(string $identifier = "", int $limit = 10, int $page
':lang' => $this->siteLang
)
);
error_log(print_r($this->sqlTypes, true));
$this->data = $query->fetchAll();
} catch (Exception $ex) {
\Drupal::logger('acdh_repo_gui')->notice($ex->getMessage());
Expand Down

0 comments on commit 5536aad

Please sign in to comment.