You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a nasty problem which results from the fact we want use XPath to both find AND create containers.
Let's assume the SPARQL query of a mapping returns two values for a variable ?var:
?var
"abc"
"def"
Now let's also assume the XML document the mapping is written to doesn't exist and we have a container string characters/{?var}. With the given variable values, we get two interpreted container strings:
characters/abc
characters/def
As the document is empty, XPath won't find anything and we would instead use the two interpreted strings to create two new nodes:
1:
<characters>
<abc></abc>
</characters>
2:
<characters>
<def></def>
</characters>
These two nodes would be added into the DOM, which is invalid as there cannot be two root nodes. We have to make sure that whenever we create new nodes, multiple container strings do not lead to invalid parallel hierarchies. Instead of creating two nodes, we have to create a tree structure. For the above example, this should look something like:
There is a nasty problem which results from the fact we want use XPath to both find AND create containers.
Let's assume the SPARQL query of a mapping returns two values for a variable
?var
:Now let's also assume the XML document the mapping is written to doesn't exist and we have a container string
characters/{?var}
. With the given variable values, we get two interpreted container strings:characters/abc
characters/def
As the document is empty, XPath won't find anything and we would instead use the two interpreted strings to create two new nodes:
1:
2:
These two nodes would be added into the DOM, which is invalid as there cannot be two root nodes. We have to make sure that whenever we create new nodes, multiple container strings do not lead to invalid parallel hierarchies. Instead of creating two nodes, we have to create a tree structure. For the above example, this should look something like:
The text was updated successfully, but these errors were encountered: