Colin's suggestion retrieves the properties of 'Model' vertex. If instead 
you need the properties of DocElem vertex, you can try this:

select * from DocElem where type = "paragraph" and out()[0].model like 
'%world%'

----+-----+-------+---------+----------+------------
#   |@RID |@CLASS |type     |uri       |out_hasModel
----+-----+-------+---------+----------+------------
0   |#48:0|DocElem|paragraph|domain.tdl|[size=1]
----+-----+-------+---------+----------+------------

if you need to be specific about which edge to traverse, then use something 
like this:
select * from DocElem where type = "paragraph" and out('hasModel')[0].model 
like '%world%'

----+-----+-------+---------+----------+------------
#   |@RID |@CLASS |type     |uri       |out_hasModel
----+-----+-------+---------+----------+------------
0   |#48:0|DocElem|paragraph|domain.tdl|[size=1]
----+-----+-------+---------+----------+------------

Note that in both cases, the Model vertex must be referenced using 
index[0], since the internal properties used to store edge references is a 
linkbag.


~nagu.

On Monday, April 13, 2015 at 9:16:44 PM UTC+5:30, Sven Hodapp wrote:
>
> Hi there,
>
> I'm experimenting with OrientDB. Now I want to do some queries with more 
> complexity.
> DocElem and Model are subclasses of V and hasModel of E, I'm assuming this:
>
>     insert into DocElem set uri = 'domain.tdl', type = "paragraph"
>
>     insert into Model set hash = '0e1f', model = "hello world"
>
>     create edge hasModel from #12:2738 to #13:2658
>
> Now reading the docs, tempted me to do a query like this:
>
>     select * from DocElem where type = "paragraph" and 
> out('hasModel').in.model like "%world%"
>
> What is my faulty reasoning? I'm using OrientDB 2.0.6.
>
> Thank you!
>
> Regards,
> Sven
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to