[MarkLogic Dev General] RE: General Digest, Vol 44, Issue 3

Danny Sokolsky dsokolsky at marklogic.com
Wed Feb 6 09:37:15 PST 2008


Hi Gary,

It is not necessary to create a range index to search.  You just need to
search over the properties axis.  For example:

xdmp:estimate(cts:search((xdmp:document-properties()), "final"))

This searches all properties for the word "final" (a
cts:word-query("final") ) and returns the number of fragments
(properties fragments in this case) that match.  Similarly, you can use
the property axis in an XPath to switch to the properties axis:

xdmp:estimate(//*/property::*[cts:contains(., "final")])

-Danny

-----Original Message-----
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Gary Vidal
Sent: Wednesday, February 06, 2008 7:52 AM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] RE: General Digest, Vol 44, Issue 3

Michael,

It appears that you cannot search the properties axis the same as you
would a node within an xml document.  Is it necessary to create a range
index for each property or is there a way to include property document
in a cts:search. It appears you cannot query the property axis using
search functions.



Gary Vidal
Sr. .Net Developer
Tel: 212-592-4946
gvidal at alm.com


-----Original Message-----
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of
general-request at developer.marklogic.com
Sent: Tuesday, February 05, 2008 3:00 PM
To: general at developer.marklogic.com
Subject: General Digest, Vol 44, Issue 3

Send General mailing list submissions to
	general at developer.marklogic.com

To subscribe or unsubscribe via the World Wide Web, visit
	http://xqzone.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
	general-request at developer.marklogic.com

You can reach the person managing the list at
	general-owner at developer.marklogic.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. choosing children node (Paul M)
   2. Re: choosing children node (David Sewell)
   3. Storing Binary and Text Data with Metadata (Gary Vidal)
   4. Re: Storing Binary and Text Data with Metadata (Michael Blakeley)


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

Message: 1
Date: Tue, 5 Feb 2008 05:46:14 -0800 (PST)
From: Paul M <pjmaip at yahoo.com>
Subject: [MarkLogic Dev General] choosing children node
To: general at developer.marklogic.com
Message-ID: <69974.19644.qm at web45505.mail.sp1.yahoo.com>
Content-Type: text/plain; charset="us-ascii"

let $n:= <doc>
<para>
<g:german>grussgot</g:german>
<english>hello</english>
 Mr Herrman
<g:german>wie gehts</g:german>

<english>how are you today</english>
We missed you at the meeting on Friday
<joke>Well, we missed the good bier that you always bring</joke>
</para>
</doc>

let $msg:=$n//para
return $msg

I only want either the english or the german version children of the
para element. What is the easiest way to implement this? I only can
envision recursively removing german child elements or english child
elements. Is there another more efficient way?







 
________________________________________________________________________
____________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://xqzone.marklogic.com/pipermail/general/attachments/20080205/9beeb
64b/attachment-0001.html

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

Message: 2
Date: Tue, 5 Feb 2008 09:24:01 -0500 (EST)
From: David Sewell <dsewell at virginia.edu>
Subject: Re: [MarkLogic Dev General] choosing children node
To: General Mark Logic Developer Discussion
	<general at developer.marklogic.com>
Message-ID:
	<alpine.OSX.1.00.0802050923050.15120 at lister.ei.Virginia.EDU>
Content-Type: text/plain; charset="us-ascii"

On Tue, 5 Feb 2008, Paul M wrote:

> let $n:= <doc>
> <para>
> <g:german>grussgot</g:german>
> <english>hello</english>
>  Mr Herrman
> <g:german>wie gehts</g:german>
>
> <english>how are you today</english>
> We missed you at the meeting on Friday
> <joke>Well, we missed the good bier that you always bring</joke>
> </para>
> </doc>
>
> let $msg:=$n//para
> return $msg
>
> I only want either the english or the german version children of the
> para element. What is the easiest way to implement this? I only can
> envision recursively removing german child elements or english child
> elements. Is there another more efficient way?

let $msg := $n//para/(* except english)
  or
let $msg := $n//para/(* except g:german)

-- 
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 801079, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: dsewell at virginia.edu   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
-------------- next part --------------
_______________________________________________
General mailing list
General at developer.marklogic.com
http://xqzone.com/mailman/listinfo/general

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

Message: 3
Date: Tue, 5 Feb 2008 10:40:51 -0500
From: "Gary Vidal" <gvidal at alm.com>
Subject: [MarkLogic Dev General] Storing Binary and Text Data with
	Metadata
To: <general at developer.marklogic.com>
Message-ID:
	
<9E00CCC86D88794D90F01E668F7DAA6603EFE4A8 at exch01ny.nyc.amlaw.corp>
Content-Type: text/plain; charset="us-ascii"

Hi,

 

I am trying to determine a way to associate a metadata xml with a Binary
or Text File.  Such that Binary nodes can be queried by their metadata 

 

 

My initial idea was to wrap the Binary or Text Data in an XmlElement and
store the content as a child node.  But loading this node would require
a custom function instead of using the
ContentSourceFactory.NewContentSource method in the .net API.

I tried to use a custom function but because the file may be quite large
serialization of the document as a base64(adds 30% more to file)  or
hexBinary caused the server to complain about the file being to large.

 

Is there a prescribed method for associating metadata with a binary or
text file that can allow the document to be queried as a single
document? 

 

Since the metadata properties are complex types I don't believe I should
use document-properties as it is inconsistent with our xml strategy
(inserting the node into the document root).

 

Can CPF links be used to associate a file to the binary file and allow
for querying to resolve the binary file?

 

[Example 1]

<sys:binary>

            <sys:metadata/>

            <sys:data>

                        [.Binary Data goes here]

            </sys:data>

</sys:binary>

 

OR

 

lnk:create("source-uri","info-uri","source","related","strong")

 

Please provide some insight?

 

Gary Vidal

Sr. .Net Developer

Tel: 212-592-4946

gvidal at alm.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://xqzone.marklogic.com/pipermail/general/attachments/20080205/40e9f
312/attachment-0001.html

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

Message: 4
Date: Tue, 05 Feb 2008 08:21:30 -0800
From: Michael Blakeley <michael.blakeley at marklogic.com>
Subject: Re: [MarkLogic Dev General] Storing Binary and Text Data with
	Metadata
To: General Mark Logic Developer Discussion
	<general at developer.marklogic.com>
Message-ID: <47A88D0A.2010106 at marklogic.com>
Content-Type: text/plain; charset="utf-8"

Gary,

This sounds like a good fit for properties: I'd recommend adding your 
metadata XML to the properties of each binary or text document. Chapter 
15 of the developer guide has more information:

   http://developer.marklogic.com/pubs/3.2/books/dev_guide.pdf

-- Mike

Gary Vidal wrote:

> I am trying to determine a way to associate a metadata xml with a
Binary
> or Text File.  Such that Binary nodes can be queried by their metadata


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4532 bytes
Desc: S/MIME Cryptographic Signature
Url :
http://xqzone.marklogic.com/pipermail/general/attachments/20080205/bd459
65e/smime-0001.bin

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

_______________________________________________
General mailing list
General at developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


End of General Digest, Vol 44, Issue 3
**************************************
_______________________________________________
General mailing list
General at developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


More information about the General mailing list