Project

General

Profile

Bug #927

metacat needs better attribute handling

Added by Chad Berkley almost 17 years ago. Updated almost 17 years ago.

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
metacat
Target version:
Start date:
12/18/2002
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
927

Description

Metacat needs to be able to explicitly search by and return attributes in an xml
document. For instance, the query /x/y/@z=a where z is an attribute should be a
valid query term. /x/y/@z should also be a valid returnfield. I think that we
can currently query by attributes in some way, although I can't remember how :)
and the documentation doesn't say how, but in any case, I think that we need to
enable the xpath type expression for it. Metacat does not currently allow
attributes to be returned via returnfields.

History

#1 Updated by Jing Tao almost 17 years ago

Now Metacat can support a path query whcih has attributes. The format is:
<queryterm searchmode="contains" casesensitive="false">
<value>denyFirst</value>
<pathexpr>acl/@order</pathexpr>
</queryterm>

Order is a attribute and its value should be "denyFirst". You can specify more
than one queryterm whcih has attribute in the squery.

Now Metacat can also support return fields have attributes. The format is:
<returnfield>keywordSet/keyword/@keywordType</returnfield>
<returnfield>originator/phone/@phonetype</returnfield>

keywordType and phonetype are attributes.

In QuerySepcification class, attribute sql query was created and in DBQuery
class, this query will be executed.
For search attributes, the sql query look like:

SELECT docid,docname,doctype,date_created, date_updated, rev FROM
xml_documents WHERE docid IN ((((SELECT DISTINCT docid FROM xml_nodes WHERE
UPPER LIKE '%DENYFIRST%' AND nodetype LIKE 'ATTRIBUTE' AND nodename
LIKE 'order' AND parentnodeid IN (SELECT nodeid FROM xml_index WHERE path LIKE
'acl') ))))

For return fields, the sql query for attributes will look like:

select xml_nodes.docid, xml_index.path, xml_nodes.nodedata, xml_nodes.nodename
from xml_index, xml_nodes where xml_index.nodeid=xml_nodes.parentnodeid and ((
xml_index.path like 'originator/phone' AND xml_nodes.nodename like
'phonetype') or ( xml_index.path like 'keywordSet/keyword' AND
xml_nodes.nodename like 'keywordType') ) AND xml_nodes.docid in ('tao.9301')
AND xml_nodes.nodetype = 'ATTRIBUTE'

#2 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 927

Also available in: Atom PDF