Giter Club home page Giter Club logo

omeka-s-module-reference's Introduction

Reference (module for Omeka S)

New versions of this module and support for Omeka S version 3.0 and above are available on GitLab, which seems to respect users and privacy better than the previous repository.

Reference is a module for Omeka S that allows to serve a glossary (an alphabetized index) of links to records or to searches for all resources classes (item types) and properties (metadata fields) of all resources of an Omeka S instance. The references can be aggregated, for example to get all dates from "dcterms:date" and "dcterms:issued" together.

These lists can be displayed in any page via a helper or a block. References can be limited by site or any other pool, and ordered alphabetically or by count.

The references are available via the api too, for example /api/references?metadata=dcterms:subject to get the list of all subjects, or /api/references?metadata=foaf:Person to get the list of all resources with class "Person". Another format for the query is provided by the module Api Info.

This Omeka S module is a rewrite and an improvement of the Reference plugin for Omeka.

Installation

See general end user documentation for installing a module.

This module requires the module [Common], that should be installed first.

If your records contains diacritic letters like É, Ù, etc., it is recommended to install the php extension intl.

  • From the zip

Download the last release Reference.zip from the list of releases, and uncompress it in the modules directory.

  • From the source and for development

If the module was installed from the source, rename the name of the folder of the module to Reference.

Then install it like any other Omeka module and follow the config instructions.

Note for an upgrade from Omeka Classic

The default slugs use the full term, with the vocabulary prefix, so the default route for subjects is now reference/dcterms:subject instead of references/subject. It can be changed in the site settings form and pages can be created with any slug.

Furthermore, the base route has been changed to singular reference instead of references. To keep or to create an alias for old plural routes, simply add/update it directly in your local.config.php, via a copy of the route part of the file config/module.config.php. Any word can be used, like lexicon, glossary, etc.

Anyway, it is recommended to use site page blocks, with any slug, so it’s not necessary to modify the config.

Usage

The site settings allows to select the terms to display. The config is the same for the main site pages or in the block form for pages. It is recommended to use site pages when possible.

Automatic site pages

The module adds pages for selected resource classes and properties at https://www.example.com/s/my-site/reference. Available pages and options can be set in the site settings. Options are:

  • Print headings: Print headers for each section (#0-9 and symbols, A, B, etc.).
  • Print skip links: Print skip links at the top and bottom of each page, which link to the alphabetical headers. Note that if headers are turned off, skiplinks do not work.
  • Print individual total: Print the total of resources for each reference.
  • Link to single: When a reference has only one item, link to it directly instead of to the items/browse page.
  • Custom url for single: May be set with modules such Clean Url or Ark. May slow the display when there are many single references.

Lists

A block allows to display the lists in any page. Furthermore,

These contents can be displayed anywere via the view helper references():

// With default values.
echo $this->references()->displayListForTerm('dcterms:subject', $query, $options);
// Get the lists.
print_r($this->references()->list('dcterms:subject', $query, $options));
// Get the count.
echo $this->references()->count('dcterms:subject', $query, $options);
// Get the initials (here to get the list of years from iso 8601 values or numeric timestamp).
print_r($this->references()->initials('dcterms:created', $query, ['initial' => 4]));
// Get the list of resources related to all subjects.
print_r($references->list('dcterms:subject', null, ['list_by_max' => 1024]));

The references are available via the api in /api/references too. Arguments are the same than above: the search query + a metadata array for the list of fields to get, and an array of options to use (see below). The same feature is available via the module Api Info too on /api/infos/references.

Tree view

The tree of references can be build with the block page "Reference tree". The references should be formatted like:

Europe
- France
-- Paris
- United Kingdom
-- England
--- London
Asia
- Japan

So:

  • One reference by line.
  • Each reference is preceded by zero, one or more "-" to indicate the hierarchy level.
  • Separate the "-" and the reference with a space.
  • A reference cannot begin with a "-" or a space.
  • Empty lines are not considered.

Via the helper:

echo $this->references()->displayTree(
    // A dash list as a text or as an array of value/level.
    $referenceLevels,
    ['site_id' => 1],
    [
        'term' => $term,
        'type' => 'properties',
        'resource_name' => 'items',
        'query_type' => 'eq',
        'link_to_single' => true,
        'custom_url' => false,
        'total' => true,
        'expanded' => true,
        'strip' => true,
        'total' => true,
        'raw' => false,
    ]
);

All arguments are optional and the default ones are set in the config page or in the block, but they can be overridden in the theme.

For order, the sort can be ['total' => 'DESC'] too.

For query, it is the standard query used in the api of Omeka, or the arguments taken from the url of an advanced search, converted into an array with parse_str. The conversion is automatically done inside the user interface (page blocks).

Api to get references and facets

To get the results via api, use a standard query and append the options you need, for example /api/references?metadata[subjects]=dcterms:subject to get the list of all subjects, or /api/references?metadata[people]=foaf:Person to get the list of all resources with class "Person". You can add multiple metadata together: /api/references?medatadata[subjects]=dcterms:subject&medatadata[creators]=dcterms:creator You can use the special metadata o:title too, but some options won't be available for it since it is managed differently inside Omeka. The metadata can be a property term, or o:item_set, o:resource_class, and o:resource_template too. If no metadata is set, you will get the totals of references for properties.

The query from the url can be simplified with text=my-text in most of the cases, so the references are filtered by this text in any property. If one or multiple fields are specified, the references are returned for these fields. The fields can be a comma separated list of an array, for example: /api/references?text=example&metadata[subjects]=dcterms:subject allows to get all references for the specified text in the specified field.

To get the facets for the search result page, you can use this query: /api/references?text=xxx&site_id=1&option[resource_name]=items&option[sort_by]=total&option[sort_order]=desc&option[filters][languages][]=fra&option[filters][languages][]=null&option[filters][languages]=&option[lang]=1&metadata[subjects]=dcterms:subject Note: if you use the filters for the language, it may be needed to add an empty language &option[filters][languages][]=null or, for string format, &option[filters][languages]=fra,null because many metadata have no language (date, names, etc.). The empty language can be an empty string too (deprecated).

To get more information about results, in particular the list of resources associated to each reference (list_by_max), use options. Options can be appended to the query. If you don't want to mix them, you can use the keys query and option.

Options are the same than the view helper:

  • resource_name: items (default), "item_sets", "media", "resources".
  • sort_by: "alphabetic" (default), "count", or any available column.
  • sort_order: "asc" (default) or "desc".
  • filters: array Limit values to the specified data. Currently managed:
    • languages: list of languages. Values without language are returned with the value "null". This option is used only for properties.
    • datatypes: array Filter property values according to the data types. Default datatypes are "literal", "resource", "resource:item", "resource:itemset", "resource:media" and "uri"; other existing ones are managed. Warning: "resource" is not the same than specific resources. Use module Bulk Edit or Bulk Check to specify all resources automatically.
    • begin: array Filter property values that begin with these strings, generally one or more initials.
    • end: array Filter property values that end with these strings.
  • values: array Allow to limit the answer to the specified values.
  • first: false (default), or true (get first resource).
  • list_by_max: 0 (default), or the max number of resources for each reference) The max number should be below 1024 (mysql limit for group_concat).
  • fields: the fields to use for the list of resources, if any. If not set, the output is an associative array with id as key and title as value. If set, value is an array of the specified fields.
  • initial: false (default), or true (get first letter of each result).
  • distinct: false (default), or true (distinct values by type).
  • datatype: false (default), or true (include datatype of values).
  • lang: false (default), or true (include language of value to result).
  • locale: empty (default) or a string or an ordered array Allow to get the returned values in the first specified language when a property has translated values. Use "null" to get a value without language. Unlike Omeka core, it gets the translated title of linked resources.
  • include_without_meta: false (default), or true (include total of resources with no metadata) (TODO Check if this option is still needed).
  • single_reference_format: false (default), or true to keep the old output without the deprecated warning for single references without named key.
  • output: "list" (default) or "associative" (possible only without added options: first, initial, distinct, datatype, or lang).

A standard resource query can be appended to the query. The property argument supports some more types for the properties: sw/nsw for "starts with" or not, ew/new for "ends with" or not, in/nin for "in list" or not, res/nres for "has resource" or not.

Don't confuse the filters and the query: the query limits the resource to search, generally a site or an item set, and the filters limits the returned list of references.

For the filters and the metadata, they can be written in various ways to simplify url request, for example:

  • metadata[ids]=o:id&metadata[titles]=o:title&metadata[collections]=o:item_set&metadata[short_titles]=bibo:shortTitle
  • metadata=o:id,o:title,o:item_set,bibo:shortTitle or
  • filters[begin][]=w&filters[begin][]=x&filters[begin][]=y&filters[begin][]=z
  • filters[begin]=w,x,y,z

To get results for aggregated metadata, use an array for the fields:

  • metadata[Dates][]=dcterms:date&metadata[Dates][]=dcterms:issued
  • metadata[Dates]=dcterms:date,dcterms:issued. The key of the metadata ("Dates" here) is used as the key and the label in the result. Don't forget that aggregated metadata are possible only for properties.

Important: The response is for all sites by default. Add argument site_id={##} or site_slug={slug} to get data for a site.

Note about linked resources

When you want to fetch all datatypes, the data types resource, resource:item, resource:itemset, etc. are returned. It is recommended to replace all types resource by the specific one in order to clarify the results. The modules Bulk Edit or Bulk Check allows to do it automatically.

TODO

  • Normalize output with o:references instead of o-module-reference:values (Omeka version 3.0).
  • Display values other than literal.
  • Manage pagination by letter and by number of references.
  • Create automatically the pages related to the block index in order to remove the global pages.
  • Fix initials for some letters (#2) via a custom DQL function for convert.
  • Manage references inside admin board.
  • Manage advanced search reference by site and in admin board.
  • Make the reference recursive (two levels currently).
  • Get the second levels via a single sql, not via api.
  • Check if the option "include_without_meta" is still needed with data types.
  • Include the fields in the main request or get them via a second request, not via api.
  • Use the new table reference_metadata when possible.
  • Simplify queries for aggregated fields (see AdvancedSearch).
  • Order by years instead of alphabetic.

Warning

Use it at your own risk.

It’s always recommended to backup your files and your databases and to check your archives regularly so you can roll back if needed.

Troubleshooting

See online issues on the module issues page on GitLab.

License

This module is published under the CeCILL v2.1 license, compatible with GNU/GPL and approved by FSF and OSI.

In consideration of access to the source code and the rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software’s author, the holder of the economic rights, and the successive licensors only have limited liability.

In this respect, the risks associated with loading, using, modifying and/or developing or reproducing the software by the user are brought to the user’s attention, given its Free Software status, which may make it complicated to use, with the result that its use is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the suitability of the software as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions of security. This Agreement may be freely reproduced and published, provided it is not altered, and that no provisions are either added or removed herefrom.

The module uses a jQuery library for the tree view, released under the MIT licence.

Copyright

  • Copyright William Mayo, 2011
  • Copyright Philip Collins, 2013 (jQuery tree view)
  • Copyright Daniel Berthereau, 2014-2024 (see Daniel-KM on GitLab)

This module is inspired from earlier work done by William Mayo (see pobocks on GitLab) in Subject Browse, with some ideas from Metadata Browser and Category Browse, that have been upgraded for Omeka 2.x too (Subject Browse (2.x), Metadata Browser (2.x), and Category Browse (2.x)). They are no longer maintained. Upgrade and improvements were made for Jane Addams Digital Edition. Performance fixes were made for Article 19.

omeka-s-module-reference's People

Contributors

daniel-km avatar giocomai avatar jajm avatar zerocrates avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mjlassila

omeka-s-module-reference's Issues

Incompatibility with CleanURL

Seems that module generated links don't work with CleanURL with "Skip "s/site-slug/" for default site" option activated.

Generated links become "/reference /{preffix:prop}" and and doesn't work.

Manual links at form "/site/{site-slug}/reference/{preffix:prop}" works.

Hide ‘Site:’ from search filters

Hello,

is it possible to hide the Site: mysite string from the results when clicking on items on a page with a Reference block? See this thread and this example. In my case I only have one site in my Omeka installation and having a 'hide ?site_id from the query' option would be ideal.

Duplicate custom labels causes failure to save

I don't know exactly if it's a bug, but I just encountered this scenario on Omeka-S v1.2, Reference v3.4.9.

I previously had dcterms:relation enabled in Reference module and labeled as slug:movements, label:Movements.

I unchecked it and then modified dcterms:audience to be the same.

After saving, it did not report an error, but it did not store the changes.

Once I manually set dcterms:relation fields back to original (or I assume any other value), then it successfully saved the changes to dcterms:audience.

So it seems to me from the outside there is some unstated assumption in the code that there can be no "name clash" and it treats slugs and labels as unique. Now that I type it, it seems relatively obvious that would be the case with slugs... so I think maybe it's just a UX issue about error message. Very minor.

add search filters through API

Is it possible to use search filters parameters to get updated facets?

eg: /api/references?metadata=dcterms:subject&resource_template_id=2

Auto fill fields on advanced search doesn't work

In Reference module, version 3.4.13, it was possible get value list for fields configured in References:

image

In current version 3.4.21 javascript code is unchanged, but module doesn't work with URLs with "output" parameter:

https://{server}/s/{siteslug}/reference/{field:prop}?output=json

Thus, value list for configured fields is not show on advanced search form.

In Readme.md , under "Usage", says:
"The results are available via json too via the module [ApiInfo]."

After install this module, URL remain without show correct data format.

General settings problem

Hi,
I have the module installed with the latest version 3.4.38.3.

When in the general settings I check the option 'Index reference metadata', the following error is generated:
ParseError
syntax error, unexpected ')'
Détails :
ParseError: syntax error, unexpected ')' in /applis/omekas/home/www/omeka-s/modules/Reference/src/Job/UpdateReferenceMetadata.php:48

The line in question is the following:
$this->logger->notice(
'Starting creation of reference metadata.', // @translate
);

Removing the comma solves the problem.

Undefined variable: referenceUrl

After updating this module to the last git version, I have this error on a index page:

Notice: Undefined variable: referenceUrl in /../modules/Reference/view/common/reference-tree.phtml on line 98

It appears only when creating an index tree.

Error: Unexpected 'Omeka\Entity\Item'

I have this error when adding a reference block (no matter which) on Omeka S 2.0.2.

Is it just because this module needs an upgrade before being usable for 2.0.2? Or is there something else to check on my side?


Omeka S a rencontré une erreur

Doctrine\ORM\Query\QueryException
[Syntax Error] line 0, col 284: Error: Unexpected 'Omeka\Entity\Item'

Détails :

Doctrine\ORM\Query\QueryException: SELECT COUNT(DISTINCT value.value) FROM Omeka\Entity\Value value INNER JOIN Omeka\Entity\Resource resource WITH value.resource = resource INNER JOIN Omeka\Entity\Item res WITH resource.id = res.id WHERE value.property = :property AND value.value IS NOT NULL AND resource.id IN(SELECT Omeka\Entity\Item.id FROM Omeka\Entity\Item Omeka\Entity\Item INNER JOIN omeka_root.itemSets omeka_2 WITH omeka_2.id IN(:omeka_3)) in /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:43
Stack trace:
#0 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(456): Doctrine\ORM\Query\QueryException::dqlError('SELECT COUNT(DI...')
#1 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2005): Doctrine\ORM\Query\Parser->syntaxError()
#2 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2362): Doctrine\ORM\Query\Parser->ScalarExpression()
#3 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(1209): Doctrine\ORM\Query\Parser->SimpleSelectExpression()
#4 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(1428): Doctrine\ORM\Query\Parser->SimpleSelectClause()
#5 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(3087): Doctrine\ORM\Query\Parser->Subselect()
#6 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2572): Doctrine\ORM\Query\Parser->InExpression()
#7 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2474): Doctrine\ORM\Query\Parser->SimpleConditionalExpression()
#8 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2450): Doctrine\ORM\Query\Parser->ConditionalPrimary()
#9 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2423): Doctrine\ORM\Query\Parser->ConditionalFactor()
#10 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2393): Doctrine\ORM\Query\Parser->ConditionalTerm()
#11 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(1360): Doctrine\ORM\Query\Parser->ConditionalExpression()
#12 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(880): Doctrine\ORM\Query\Parser->WhereClause()
#13 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(847): Doctrine\ORM\Query\Parser->SelectStatement()
#14 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(260): Doctrine\ORM\Query\Parser->QueryLanguage()
#15 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(359): Doctrine\ORM\Query\Parser->getAST()
#16 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(283): Doctrine\ORM\Query\Parser->parse()
#17 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(295): Doctrine\ORM\Query->_parse()
#18 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(967): Doctrine\ORM\Query->_doExecute()
#19 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(922): Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(NULL, 4)
#20 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(803): Doctrine\ORM\AbstractQuery->execute(NULL, 4)
#21 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(831): Doctrine\ORM\AbstractQuery->getSingleResult(4)
#22 /sites/erudhilor/www/web_main/modules/Reference/src/Mvc/Controller/Plugin/Reference.php(841): Doctrine\ORM\AbstractQuery->getSingleScalarResult()
#23 /sites/erudhilor/www/web_main/modules/Reference/src/Mvc/Controller/Plugin/Reference.php(293): Reference\Mvc\Controller\Plugin\Reference->countReferences(1, 'properties', 'Omeka\\Entity\\It...', Array)
#24 /sites/erudhilor/www/web_main/modules/Reference/src/Site/BlockLayout/Reference.php(121): Reference\Mvc\Controller\Plugin\Reference->count('dcterms:title', 'properties', 'items', Array)
#25 /sites/erudhilor/www/web_main/application/src/View/Helper/BlockLayout.php(124): Reference\Site\BlockLayout\Reference->render(Object(Zend\View\Renderer\PhpRenderer), Object(Omeka\Api\Representation\SitePageBlockRepresentation))
#26 /sites/erudhilor/www/web_main/application/view/omeka/site/page/content.phtml(9): Omeka\View\Helper\BlockLayout->render(Object(Omeka\Api\Representation\SitePageBlockRepresentation))
#27 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(506): include('/sites/erudhilo...')
#28 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(207): Zend\View\Renderer\PhpRenderer->render(NULL)
#29 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#30 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#31 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#32 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#33 /sites/erudhilor/www/web_main/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php(105): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#34 /sites/erudhilor/www/web_main/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Zend\Mvc\MvcEvent))
#35 /sites/erudhilor/www/web_main/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent))
#36 /sites/erudhilor/www/web_main/vendor/zendframework/zend-mvc/src/Application.php(367): Zend\EventManager\EventManager->triggerEvent(Object(Zend\Mvc\MvcEvent))
#37 /sites/erudhilor/www/web_main/vendor/zendframework/zend-mvc/src/Application.php(348): Zend\Mvc\Application->completeRequest(Object(Zend\Mvc\MvcEvent))
#38 /sites/erudhilor/www/web_main/index.php(21): Zend\Mvc\Application->run()
#39 {main}

Next Doctrine\ORM\Query\QueryException: [Syntax Error] line 0, col 284: Error: Unexpected 'Omeka\Entity\Item' in /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:54
Stack trace:
#0 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(456): Doctrine\ORM\Query\QueryException::syntaxError('line 0, col 284...', Object(Doctrine\ORM\Query\QueryException))
#1 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2005): Doctrine\ORM\Query\Parser->syntaxError()
#2 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2362): Doctrine\ORM\Query\Parser->ScalarExpression()
#3 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(1209): Doctrine\ORM\Query\Parser->SimpleSelectExpression()
#4 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(1428): Doctrine\ORM\Query\Parser->SimpleSelectClause()
#5 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(3087): Doctrine\ORM\Query\Parser->Subselect()
#6 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2572): Doctrine\ORM\Query\Parser->InExpression()
#7 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2474): Doctrine\ORM\Query\Parser->SimpleConditionalExpression()
#8 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2450): Doctrine\ORM\Query\Parser->ConditionalPrimary()
#9 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2423): Doctrine\ORM\Query\Parser->ConditionalFactor()
#10 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2393): Doctrine\ORM\Query\Parser->ConditionalTerm()
#11 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(1360): Doctrine\ORM\Query\Parser->ConditionalExpression()
#12 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(880): Doctrine\ORM\Query\Parser->WhereClause()
#13 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(847): Doctrine\ORM\Query\Parser->SelectStatement()
#14 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(260): Doctrine\ORM\Query\Parser->QueryLanguage()
#15 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(359): Doctrine\ORM\Query\Parser->getAST()
#16 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(283): Doctrine\ORM\Query\Parser->parse()
#17 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(295): Doctrine\ORM\Query->_parse()
#18 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(967): Doctrine\ORM\Query->_doExecute()
#19 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(922): Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(NULL, 4)
#20 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(803): Doctrine\ORM\AbstractQuery->execute(NULL, 4)
#21 /sites/erudhilor/www/web_main/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(831): Doctrine\ORM\AbstractQuery->getSingleResult(4)
#22 /sites/erudhilor/www/web_main/modules/Reference/src/Mvc/Controller/Plugin/Reference.php(841): Doctrine\ORM\AbstractQuery->getSingleScalarResult()
#23 /sites/erudhilor/www/web_main/modules/Reference/src/Mvc/Controller/Plugin/Reference.php(293): Reference\Mvc\Controller\Plugin\Reference->countReferences(1, 'properties', 'Omeka\\Entity\\It...', Array)
#24 /sites/erudhilor/www/web_main/modules/Reference/src/Site/BlockLayout/Reference.php(121): Reference\Mvc\Controller\Plugin\Reference->count('dcterms:title', 'properties', 'items', Array)
#25 /sites/erudhilor/www/web_main/application/src/View/Helper/BlockLayout.php(124): Reference\Site\BlockLayout\Reference->render(Object(Zend\View\Renderer\PhpRenderer), Object(Omeka\Api\Representation\SitePageBlockRepresentation))
#26 /sites/erudhilor/www/web_main/application/view/omeka/site/page/content.phtml(9): Omeka\View\Helper\BlockLayout->render(Object(Omeka\Api\Representation\SitePageBlockRepresentation))
#27 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(506): include('/sites/erudhilo...')
#28 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(207): Zend\View\Renderer\PhpRenderer->render(NULL)
#29 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#30 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#31 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#32 /sites/erudhilor/www/web_main/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#33 /sites/erudhilor/www/web_main/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php(105): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#34 /sites/erudhilor/www/web_main/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Zend\Mvc\MvcEvent))
#35 /sites/erudhilor/www/web_main/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent))
#36 /sites/erudhilor/www/web_main/vendor/zendframework/zend-mvc/src/Application.php(367): Zend\EventManager\EventManager->triggerEvent(Object(Zend\Mvc\MvcEvent))
#37 /sites/erudhilor/www/web_main/vendor/zendframework/zend-mvc/src/Application.php(348): Zend\Mvc\Application->completeRequest(Object(Zend\Mvc\MvcEvent))
#38 /sites/erudhilor/www/web_main/index.php(21): Zend\Mvc\Application->run()
#39 {main}


Index Reference Metadata job error

When running the Index Reference Metadata job, I'm getting the following error:

2024-02-02T02:21:09+00:00 NOTICE (5): Starting creation of reference metadata. {"referenceId":"Reference/Metadata/job_10"}
2024-02-02T02:21:10+00:00 ERR (3): Doctrine\ORM\EntityNotFoundException: Unable to find "DoctrineProxies_CG_\Omeka\Entity\Item" entity identifier associated with the UnitOfWork in /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php:43
Stack trace:
#0 /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(3082): Doctrine\ORM\EntityNotFoundException::noIdentifierFound('DoctrineProxies...')
#1 /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(690): Doctrine\ORM\UnitOfWork->getEntityIdentifier(Object(DoctrineProxies_CG_\Omeka\Entity\Item))
#2 /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(727): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->prepareUpdateData(Object(Reference\Entity\Metadata), true)
#3 /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(266): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->prepareInsertData(Object(Reference\Entity\Metadata))
#4 /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1128): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()
#5 /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(425): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#6 /home/annelies/public_html/plpr4/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)
#7 /home/annelies/public_html/plpr4/modules/Reference/src/Job/UpdateReferenceMetadata.php(103): Doctrine\ORM\EntityManager->flush()
#8 /home/annelies/public_html/plpr4/application/src/Job/DispatchStrategy/Synchronous.php(34): Reference\Job\UpdateReferenceMetadata->perform()
#9 /home/annelies/public_html/plpr4/modules/Common/src/Job/Dispatcher.php(27): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#10 /home/annelies/public_html/plpr4/application/data/scripts/perform-job.php(66): Common\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#11 {main} {"referenceId":"Reference/Metadata/job_10"}

I'm not sure if the problem is with the Reference or Advanced Search module.

Omeka 4.04
Advanced Search (3.4.20), Block Plus (3.4.20), CSV Import (2.5.1), Common (3.4.49), Custom Ontology (3.4.5.1), Data Type RDF (3.4.8), File Sideload (1.7.1), Internationalisation (3.4.13), Mapping (1.10.0), Menu (3.4.8), Numeric Data Types (1.11.3), Random Items Block (0.3.0), Reference (3.4.47)

Outdated link in Readme

In installation section the link provided leads to outdated Reference-3.4.21 release in gitlab.

Download the last release Reference.zip from the list of releases, and uncompress it in the modules directory.

Linked metadata

This module does not work for linked fields (for example if you indicate for item A another omeka item B as (DC)Creator and use Reference to display all creators, item B will not be showed in the creators list.)

Any plan to support linked fields in the futur?

Error installing

Hi,

I've run into a problem installing (actually, upgrading) this module. Once I unpack these files, I get the following PHP fatal errors:

Warning: require_once(/mysite/modules/Reference/vendor/autoload.php): failed to open stream: No such file or directory in /mysite/modules/Reference/Module.php on line 35

Fatal error: require_once(): Failed opening required '/mysite/modules/Reference/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php72/root/usr/share/pear') in /mysite/modules/Reference/Module.php on line 35

Any thoughts?

Using o:resource_class as metadata raises error

When trying to use o:resource_class as a metadata an error is raised.

http://localhost:9002/api/references?metadata[test]=o:resource_class

Result:

Error
Call to a member function label() on array

Details:

Error: Call to a member function label() on array in /var/www/html/modules/Reference/src/Mvc/Controller/Plugin/References.php:510
Stack trace:
#0 /var/www/html/modules/Reference/src/Controller/ApiController.php(98): Reference\Mvc\Controller\Plugin\References->list()
#1 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(377): Reference\Controller\ApiController->getList()
#2 /var/www/html/application/src/Controller/ApiController.php(168): Laminas\Mvc\Controller\AbstractRestfulController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#3 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Omeka\Controller\ApiController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#4 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#5 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#6 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(307): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#7 /var/www/html/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractRestfulController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#8 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#9 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#10 /var/www/html/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#11 /var/www/html/index.php(21): Laminas\Mvc\Application->run()
#12 {main}```

Adding reference to a .phtml page

I am trying to add reference to the browse.phtml page.

I pasted this code to the page. bio:place is indexed by reference and appears in the /reference page.

But I have an error: Undefined variable: term .

Should I define $term somewhere?

<?php
echo $this->reference()->displayListForTerm($term,
    [
        'type' => 'bio:place',
        'resource_name' => 'items',
        'order' => ['alphabetic' => 'ASC'],
        'per_page' => null,
        'page' => null,
    ],
    [
        'query_type' => 'eq',
        'link_to_single' => true,
        'total' => true,
        'skiplinks' => true,
        'headings' => true,
        'raw' => false,
    ]
);
?>

Cannot upgrade from version 3.4.5 to 3.4.30.3

I am having issues upgrading the Reference module after doing a major migration from an old Omeka instance.
The previous version of the module is 3.4.5, and I try to upgrade to 3.4.30.3.

I get the following error message:

TypeError
Argument 1 passed to Reference\Mvc\Controller\Plugin\ReferenceTree::convertFlatLevelsToTree() must be of the type array, string given, called in /var/www/html/modules/Reference/data/scripts/upgrade.php on line 64

Details:

TypeError: Argument 1 passed to Reference\Mvc\Controller\Plugin\ReferenceTree::convertFlatLevelsToTree() must be of the type array, string given, called in /var/www/html/modules/Reference/data/scripts/upgrade.php on line 64 and defined in /var/www/html/modules/Reference/src/Mvc/Controller/Plugin/ReferenceTree.php:112
Stack trace:
#0 /var/www/html/modules/Reference/data/scripts/upgrade.php(64): Reference\Mvc\Controller\Plugin\ReferenceTree->convertFlatLevelsToTree('')
#1 /var/www/html/modules/Reference/src/Generic/AbstractModule.php(115): require_once('/var/www/html/m...')
#2 /var/www/html/application/src/Module/Manager.php(321): Generic\AbstractModule->upgrade('3.4.5', '3.4.30.3', Object(Laminas\ServiceManager\ServiceManager))
#3 /var/www/html/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade(Object(Omeka\Module\Module))
#4 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ModuleController->upgradeAction()
#5 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#6 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#7 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#8 /var/www/html/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#9 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#10 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#11 /var/www/html/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#12 /var/www/html/index.php(21): Laminas\Mvc\Application->run()
#13 {main}

This made me think something was off on line 64 of the upgrade.php script, so I manually forced the $tree variable to an empty array, and the migration then succeeded.

Multilanguage facets

Is it possible to retrieve the language of a value in the facet links?

We use one item pool for multiple sites (with different languages). In those items we add multiple values for a metadata field and set the language of each of those using the new language feature. At the moment there doesn't seem to be a way to determine the language of a value once it has become a facet link.

For instance I have one item with metadata field dc:language having 2 values:

  • Dutch (with language 'en')
  • Nederlands (with language 'nl')

On the search page this results in 2 facet links:
-Dutch (1)
-Nederlands (1)

In the context of a multilingual site we'd like to be able to hide the facet links that aren't set to 'en' on the English website for example.

For this example I'm using the mysql version of the facets, so no solr or other indexing.

'Jump to' links not working when selecting one-page option

Hello,

when deselecting the 'one page' option here:

Screenshot 2022-09-23 at 14-30-51 Edit · Browse by original language · Pages · BOSLIT

The link to each letter in the list of letters on the top:

Screenshot 2022-09-23 at 14-27-31 Browse by original language · boslit · BOSLIT

doesn't do anything. I suspect this is because the hyperlinks point to a lowercase letter, whilst the ids of the anchors in the page are in capital letter.

<a href="#c">C</a>

<h3 class="reference-heading" id="C"><a href="#reference-skiplinks">C</a></h3>

Can these be lowercase letters if the 'one page' option is selected?

Upgrade from 3.4.23.3 version to 3.4.29.3 does not work

I tried to upgrade this module directly from 3.4.23.3 version to 3.4.29.3.

Module was not working (no reference displayed). I upgrade release from release without skipping versions and it is working now.

I just post this to warn people who could face the same issue.

Translation issue

My site is in French (set in global settings). However I have a not translated title for each glossary:

Browse items by "Articles par leurs années de publication" (43 headings)

It is strange because the file fr.po contains the correct translation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.