We are considering using the elements below as format category, but MARC codes for 007/00 is not enough to map all of them.
Can we add our own codes to "xc:type007" and "dcterms:type" ? How should we do?

- Book
- Journal
- E-Book
- E-Journal
- E-resource
- Journal article
- Kyushu U-related
- Map
- Score
- Audio-visual material
- Dissertation
- Others

Comments

pkiraly’s picture

Hi,

This is a long project I'll finish this week.
Summary: there will be a configuration form, where you can add conditions of the value of facets.
The conditions can be based on any of the fields.
The document type conditions set (which govers the document type facet) will be supplied with default rules, what you can override.

Péter

yurikoikawa’s picture

Hi Péter,

I'm sorry for being late to reply.

Thank you for your cooperation.
I'm looking forward to hearing from you again.

pkiraly’s picture

Hi Yuriko,

I have commited some changes, including this one. On the facet editing page (xc/search/indexing/facets/add and xc/search/indexing/facets/%/edit) you can add your custom PHP codes to meet this requirement. I modified the default fields, so the format facet settings is similar (but not identical) to your request. I followed Jennifer's original specs, and it is slightly different than yours, but I hope you will find the logic. You need some metadata investigation, and maybe some trial and error, before you find the good solution.
You should run update.php, then go to xc/search/indexing/facets and click on restore defaults. If you made some changes in the facet indexing settings, save your database tables.

Hope it helps. If you have more questions, please contact me in the usual addresses: mail, skype (kirunews), issue queue etc.

Hope this helps.

Regards,
Péter

yurikoikawa’s picture

Hi Péter,

It is a great help for us.
We'll try it soon. Thank you.

Yuriko

pkiraly’s picture

Hi Yuriko,

Today I found a typo in the code I commited yesterday. I changed it, and seems to be good now. If there's still problem, please let me know.

Péter

pkiraly’s picture

Hi Yuriko,

I investigated a lot the format facet problem. There were some problems, which prevented the previous solution to be really workable. These are:
- a simple 'actual field value' == 'expected value' comparision is not enough, because on both side there could be multiple values (practically each field may have multiple values, and our expected value is sometimes a list of values. I created two utility function: xc_util_contains($container, $values), and xc_util_is_url($url). Whith this two function the writing of the function, which evaluate conditions, and claims the value of the facets became more easy.
- as you may know the harvester process has two phase: harvesting/indexing and data normalization. In this later phase we merge the values of the connected work and expression level records into manifestations. This is the point, where we have all information together to evaluace the criteria of the format facet values. So I moved the process from the first phrase to this second phrase. It resulted, that the first phrase became somewhat quicker, and the later somewhat longer in time.
- during the test period it became clear, that the expected values in the specification and in the actual records do not fit in respect of lower case/upper case. So I needed to transform the values to lowercase before comparing them.

I tried it with a small record set, and a 60K record set. Tomorrow I will try it on a 500K record set. I hope that it will work for you as well. I commited all into the CVS repository. I suggest you to update files, run update.php (for another reason -- i changed the datatable of the OAI Harvester module as well), and go to eXtensible Catalog (XC) > XC Search > Indexing > Manage facets and click 'Restore defaults'. Then check the Format facet by clicking 'view' or 'edit' links. Of course: create a backup if you have important changes.

Hope this helps.

Péter