Predefined joins in Tamino

There is an example in the Tamino documentation
that shows the usage of predefined joins. All is looking good when you are using objectIDs to represent a join. But in the more interesting case of keys (a key is the contents of a Node in an instance that makes it unique e.g. a customer number and a product number)joins do not work. It’s a very important moment, because keys allow us to join nested nodes, not only root nodes. Please, help!
May be anyone has working example?

Looking forward for you reply.
Thank you.

It works for me with Tamino 2.3 as well as with 2.2.

I have these 3 schemas defined where 2 joins are defined. One with by ino:id one by key :

Employees

<?xml version="1.0"?>
<ino:collection ino:name=“join” ino:key=“ID001”>
<ino:doctype ino:name=“employee” ino:key=“ID_employee” ino:options=“READ INSERT UPDATE DELETE” ino:structure-index=“CONDENSED”>
<ino:node ino:name=“employee” ino:key=“id0000000270” ino:obj-type=“SEQ” ino:parent=“ID_employee” ino:search-type=“no” ino:data-type=“WCHAR” ino:map-type=“InfoField”/>
<ino:node ino:name=“department” ino:key=“id0000000271” ino:obj-type=“PCDATA” ino:parent=“id0000000270” ino:search-type=“no” ino:data-type=“INTEGER” ino:map-type=“InfoField”/>
<ino:node ino:name=“belongs” ino:key=“id0000000272” ino:obj-type=“EMPTY” ino:parent=“id0000000271” ino:search-type=“no” ino:map-type=“Object” ino:query=“did=%department” ino:object-ref=“join/department”/>
<ino:node ino:name=“name” ino:key=“id0000000273” ino:obj-type=“PCDATA” ino:parent=“id0000000270” ino:search-type=“standard text” ino:data-type=“WCHAR” ino:map-type=“InfoField”/>
</ino:doctype>
</ino:collection>

Project:

<?xml version="1.0"?>
<ino:collection ino:name=“join” ino:key=“ID001”>
<ino:doctype ino:name=“project”
ino:key=“ID_project”
ino:options=“READ INSERT UPDATE DELETE”
ino:structure-index=“CONDENSED”>
<ino:node ino:name=“project”
ino:key=“id0000000274”
ino:obj-type=“SEQ”
ino:parent=“ID_project”
ino:search-type=“no”
ino:data-type=“WCHAR”
ino:map-type=“InfoField”/>
<ino:node ino:name=“description”
ino:key=“id0000000275”
ino:obj-type=“PCDATA”
ino:parent=“id0000000274”
ino:search-type=“text”
ino:data-type=“WCHAR”
ino:map-type=“InfoField”/>
<ino:node ino:name=“member”
ino:key=“id0000000276”
ino:obj-type=“PCDATA”
ino:parent=“id0000000274”
ino:multiplicity="+"
ino:search-type=“standard”
ino:data-type=“INTEGER”
ino:map-type=“InfoField”/>
<ino:node ino:name=“emp”
ino:key=“id0000000277”
ino:obj-type=“EMPTY”
ino:parent=“id0000000276”
ino:search-type=“no”
ino:map-type=“Object”
ino:query="@ino:id=%member"
ino:object-ref=“join/employee”/>
<ino:node ino:name=“name”
ino:key=“id0000000278”
ino:obj-type=“PCDATA”
ino:parent=“id0000000274”
ino:search-type=“text”
ino:data-type=“WCHAR”
ino:map-type=“InfoField”/>
</ino:doctype>
</ino:collection>

Department:

<?xml version="1.0"?>
<ino:collection ino:name=“join” ino:key=“ID001”>
<ino:doctype ino:name=“department”
ino:key=“ID_department”
ino:options=“READ INSERT UPDATE DELETE”
ino:structure-index=“CONDENSED”>
<ino:node ino:name=“department”
ino:key=“id0000000266”
ino:obj-type=“SEQ”
ino:parent=“ID_department”
ino:search-type=“no”
ino:data-type=“WCHAR”
ino:map-type=“InfoField”/>
<ino:node ino:name=“description”
ino:key=“id0000000267”
ino:obj-type=“PCDATA”
ino:parent=“id0000000266”
ino:search-type=“text”
ino:data-type=“WCHAR”
ino:map-type=“InfoField”/>
<ino:node ino:name=“did”
ino:key=“id0000000268”
ino:obj-type=“PCDATA”
ino:parent=“id0000000266”
ino:search-type=“standard”
ino:data-type=“INTEGER”
ino:map-type=“InfoField”/>
<ino:node ino:name=“name”
ino:key=“id0000000269”
ino:obj-type=“PCDATA”
ino:parent=“id0000000266”
ino:search-type=“text”
ino:data-type=“WCHAR”
ino:map-type=“InfoField”/>
</ino:doctype>
</ino:collection>

After adding some (consistent) data to it the following query works:

employees[name~=“peter”]/department/belongs/name

which shows the name of "peter"s department.

Hello,

We used your schemas as examples for creating joins, but when we try to define them we get this error message:

"Invalid mapping specification: invalid object reference specification Line 6, Column 0: Element name=belongs, missing Node reference"

So we couldn’t try it any further. Any idea of what the problem could be?

Matis Workgroup
matis@siet.ch

Don’t forget to define the referenced schema first,before you define the schema containing the join.

Tom

The example above is a little bit tricky :wink: - you have to define the department, then the employees and at last the project schema.

[This message was edited by tomklonikowski on 06 Aug 2001 at 14:48.]

Ok we solved this problem (we just forgot to define a schema before another), but now, when we try to query the ‘employee’ schema we get a ‘Non-numeric items’ error message (ino:code=“INOXZE9696”)

Any idea?

Thanks in advance.

Matis Workgroup

Ok, all problems solved. Thanks for your help.

Matis Workgroup

I used following data to test, but
employees[name~=“peter”]/department/belongs/name
return 0 record
if I query employees[name~=“peter”]/department
return:

here is the data:
department:
<?xml version="1.0" encoding="ISO-8859-1"?>

This is 1
1
Human Resource


This is 2
2
Finance


This is 3
3
IT

employee:
<?xml version="1.0" encoding="ISO-8859-1"?>


John



Frank



Jimmy



Tom



Peter

What’s wrong? Please help me. Thanks in advance.

Hi Richard
It still works for me (Tamino 2.3).
In my example the schema name is “employee” in your query it’s called “employees”. Please check whether you have the right schema definitions including indices.

Hi,Peter
Sorry, I did use “employee” in query. I just copied the schemas you posted. I am using Tamino 2.3.1.4 trial version in starter kit, is it matter?