fighting with itql since yesterday again ...
> (1) The query: > > select $object from <#ri> where $object <mulgara:is> 'demo' > > returns a single element: > > <result> > <object>demo</object> > </result> > > even though there is no object in the repository with this PID. of course it does -- you defined that $object _is_ 'demo'. so, that's what you get. > I'd like to be able to issue queries like: > > select $object $label $identifier $state > from <#ri> > where $object <fedora-model:label> $label > and $object <dc:identifier> $identifier > and $object <fedora-model:state> $state > and $object <mulgara:is> 'demo:10' > > This query returns no results even though the PID 'demo:10' exists. > What am I doing wrong? you never really got $object -- what you do is saying that $object has the model $label. but since $label is never assigned a value ... > (2) I'd also like to perform wild-card searches on PIDs; for example > > select $object, $label, $identifier > from <#ri> > where $object <fedora-model:label> $label > and $object <dc:identifier> $identifier > and $object <has_pid> 'demo*' in <#ri-fullText> > > How does one specify the <has_pid> predicate/property in this query? you might be able to taht with 'having' > The following works quite happily but I'd not like to assume that the DC > identifier always matched the PID. > > select $object $label $identifier > from <#ri> > where $object <fedora-model:label> $label > and $object <fedora-model:ownerId> $ownerId > and $object <dc:identifier> $identifier > and $object <dc:identifier> 'demo*' in <#ri-fullText> > well, basically, $object should be your id -- what you are doing wrong is getting $object at all. imo it has to go like that: select $object $label $identifier from <#ri> where $object <fedora-model:hasModel> <info:fedora/my:model> and ... or for your label (untested) something like: select $object $label $identifier from <#ri> where $object <fedora-model:label> 'a label name' and ... see http://docs.mulgara.org/itqlcommands/select.html ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ Fedora-commons-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
