4
votes

Today I got a strange output from the MarkLogic query console. The ML query console returned an empty query sequence when I tried to get document properties of a document that already exists in the MarkLogic Database.

This returned a document:

 fn:doc("/rooturi/abcd.xml")

... and this time it returned an empty sequence:

 xdmp:document-properties("/rooturi/abcd.xml")

Can anyone help me?

Thanks.

2

2 Answers

4
votes

No, documents don't have properties by default. You can add them with xdmp:document-set-properties() or xdmp:document-add-properties(). Check out http://docs.marklogic.com/ for details.

Note that you can also only have properties with no corresponding document, something that is called "naked properties".

1
votes

Also note that if you create 'directory nodes' either explicitly or by the database setting those are actually property documents. (one per directory).

Besides CPF some other toolkits and features make use of properties such as the DLS (Library Services) and 'maintain last modification'

See http://docs.marklogic.com/guide/admin/databases#id_93323 for information on database settings that will implicitly create property nodes.