Seed values are the starting values for an operation. For example if you want 
to calculate Kevin Bacon's friends to seven generations, the seed value would 
represent Kevin Bacon. There is an example for for sem:transitive-closure() at 
http://marklogic.github.com/semantic/

Does your example do what you want? I think so, but I haven't worked through it 
completely. Another way might two sem:subject-for-predicate() calls, and a map 
operation for the join. That might be faster for a simple case like this.

-- Mike

On 16 Jan 2013, at 11:26 , "Steiner, David J. (LNG-DAY)" 
<[email protected]> wrote:

>  
> Looking into using some tuples in ML, so I want to make sure I am using the 
> functions correctly.  I loaded 721 million tuples, so spot checking results 
> is less than reassuring since results are huge.
>  
> A side note/question: I’m not sure I completely understand the format for 
> “seeds” and neither the reference nor the overview have an example where it 
> is used.  I’m not sure I want to use it just yet, but it would be nice if 
> someone has a better explanation of what a seed would look like for some of 
> the functions that take them.
>  
> At any rate, I’ve come to the point of where I want to do something like: 
> show me the subjects that have a tuple that has a predicate with value1 and 
> also a tuple with value2.  My current attempt at this is:
>  
> xquery version "1.0-ml";
>  
> import module namespace sem="http://marklogic.com/semantic";
> at "/modules/djs/semantic.xqy";
>  
> let $results := sem:subject-for-join(
>   (sem:object-predicate-join(
>     'this',
>     'predicate1'),
>    sem:object-predicate-join(
>     'that',
>     'predicate2')
> ))
>  
> return
> fn:count($results)
>  
> I’ve spot checked several of the results (i.e., I get the subjects and look 
> at the tuples for those subjects) and have not come across any that aren’t 
> correct (they have both of the predicate-object combos that I’ve specified).
>  
> For those in the know, am I using these correctly?
>  
> Thanks,
> David
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to