marklogic / entity-services

Data modeling and code scaffolding for data integration in MarkLogic
https://docs.marklogic.com/guide/entity-services
Apache License 2.0
7 stars 10 forks source link

extract-instance-SchemaCompleteEntityType returns an additional property #173

Closed bsrikan closed 7 years ago

bsrikan commented 8 years ago

Query:

import module namespace es="http://marklogic.com/entity-services" at "/MarkLogic/entity-services/entity-services.xqy"; 
import module namespace ext = "http://marklogic.com/testing-entity-type#SchemaCompleteEntityType-0.0.1" at "/conv/SchemaCompleteEntityType-0.0.1.xqy";
declare option xdmp:mapping "false"; 

ext:extract-instance-SchemaCompleteEntityType( doc('10253.xml'))

Output:

{
"$attachments": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Order OrderID=\"10253\">\n\t<CustomerID>HANAR</CustomerID>\n\t<EmployeeID>3</EmployeeID>\n\t<OrderDate>1996-07-10T12:27:52</OrderDate>\n\t<RequiredDate>1996-07-24T09:56:32</RequiredDate>\n\t<ShippedDate>1996-07-16T22:15:30</ShippedDate>\n\t<ShipVia>2</ShipVia>\n\t<Freight>58.1700</Freight>\n\t<ShipName>Hanari Carnes</ShipName>\n\t<ShipAddress>Rua do Paço, 67</ShipAddress>\n\t<ShipCity>Rio de Janeiro</ShipCity>\n\t<ShipRegion>RJ</ShipRegion>\n\t<ShipPostalCode>05454-876</ShipPostalCode>\n\t<ShipCountry>Brazil</ShipCountry>\n\t<OrderDetails>\n\t\t<OrderDetail>\n\t\t\t<ProductID>31</ProductID>\n\t\t\t<UnitPrice>10.0000</UnitPrice>\n\t\t\t<Quantity>20</Quantity>\n\t\t\t<Discount>0</Discount>\n\t\t</OrderDetail>\n\t\t<OrderDetail>\n\t\t\t<ProductID>39</ProductID>\n\t\t\t<UnitPrice>14.4000</UnitPrice>\n\t\t\t<Quantity>42</Quantity>\n\t\t\t<Discount>0</Discount>\n\t\t</OrderDetail>\n\t\t<OrderDetail>\n\t\t\t<ProductID>49</ProductID>\n\t\t\t<UnitPrice>16.0000</UnitPrice>\n\t\t\t<Quantity>40</Quantity>\n\t\t\t<Discount>0</Discount>\n\t\t</OrderDetail>\n\t</OrderDetails>\n</Order>", 
"$type": "SchemaCompleteEntityType", 
"orderId": null, 
"dateKey": null, 
"referenceInThisFile": {
"$attachments": null, 
"$type": "OrderDetails", 
"$ref": null
}, 
"externalReference": {
"$type": "OrderDetails", 
"$ref": null
}
}

referenceInThisFile and maybe externalReference (both local refs) are being returned and external refs in the model are not. Not sure what to expect.

grechaw commented 8 years ago

in PR

bsrikan commented 8 years ago

Tests ran successfully in regression. Shipping the bug.