Guest
(Guest)
May 14, 2001, 11:19pm
1
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.
Guest
(Guest)
June 25, 2001, 9:16pm
2
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.
Guest
(Guest)
August 6, 2001, 7:24pm
3
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 Workgroupmatis@siet.ch
Guest
(Guest)
August 6, 2001, 8:06pm
4
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 - 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.]
Guest
(Guest)
August 6, 2001, 8:16pm
5
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
Guest
(Guest)
August 6, 2001, 8:29pm
6
Ok, all problems solved. Thanks for your help.
Matis Workgroup
Guest
(Guest)
September 21, 2001, 9:40pm
7
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.
Guest
(Guest)
October 19, 2001, 6:26pm
8
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.
Guest
(Guest)
October 19, 2001, 8:02pm
9
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?