Thanks for the responses.

However, the query

/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> 'info:fedora/demo:10'/

doesn't return any results either. (Yes, there is an object with pid demo:10.)

I'm beginning to wonder whether '$object' and 'pid' are considered quite
different beasties by FedoraCommons even though they 'look' the same in a query
result...

(And, I have read the documentation on the mulgara web-site several times. It
doesn't define the '$object' concept.)

Cheers.

Janna Wemekamp


Gramsbergen, Egbert wrote:

Back to the original question: try with

$object <mulgara:is> <info:fedora/demo:10>

That should work.
Success,

Egbert Gramsbergen
-----Original Message-----
From: arne anka [mailto:[email protected]]
Sent: Wed 4/8/2009 12:37 PM
To: [email protected]
Subject: Re: [Fedora-commons-users] Questions re iTQL queries involving PIDs

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

------------------------------------------------------------------------

------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
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

Reply via email to