I figured out how to get a Œblind¹ bind to work efficiently - add a dummy
pattern referencing the source variable before the bind.

First off, the example I provided previously is somewhat of a made up case
and rewriting to use values instead of bind is fine.

My real use case is looking up all the subjects that are about the same
real-world entity, but are from different sources. That¹s implemented as a
graph of owl:sameAs between each set of subjects that are about one
entity. The following pattern produces the list of all subjects for the
same entity, including the entry subject. In particular, it returns the
entry subject when it¹s the only subject for the entity and, therefore,
has no owl:sameAs.


   { ?entry_subj (owl:sameAs|^owl:sameAs)+ ?other_subj .}
     union
   { ?entry_subj <void://void> <void://void> . ## this dummy pattern
avoids a table scan
     bind (?entry_subj as ?other_subj) }


Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (2000 Galloping Hill Road, Kenilworth,
New Jersey, USA 07033), and/or its affiliates Direct contact information
for affiliates is available at 
http://www.merck.com/contact/contacts.html) that may be confidential,
proprietary copyrighted and/or legally privileged. It is intended solely
for the use of the individual or entity named on this message. If you are
not the intended recipient, and have received this message in error,
please notify us immediately by reply e-mail and then delete it from 
your system.

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

Reply via email to