Thanks! That works for now. Im glad you found the bug.
There is still minor issue with the combined text, as the concat introduces
new spaces in the sentences before commas and dots. Those can be fixed
later on, but i still think it would be better to include flattened texts
properties to sxml from mixed content.
tiistai, 17. kesäkuuta 2014 4.20.50 UTC+3 Holger Knublauch kirjoitti:
>
> Hi Miika,
>
> try
>
> SELECT GROUP_CONCAT(?str)
> WHERE {
> {
> SELECT *
> WHERE {
> ?comment a :comment .
> ?comment composite:child ?child .
> ?child composite:index ?index .
> OPTIONAL {
> ?child sxml:text ?text .
> }
> OPTIONAL {
> ?child composite:child/sxml:text ?nestedText .
> }
> BIND (IF(bound(?text), 1, 2) AS ?minorIndex) .
> BIND (COALESCE(?text, ?nestedText) AS ?str)
> }
> ORDER BY ?index ?minorIndex
> }
> }
>
> I believe I just found a bug in SXML - it's reusing the same composite
> child index twice for mixed content, and we will look into fixing this for
> 4.5. The ?minorIndex trick above is to work around that issue.
>
> Note that the solution above only works for a nesting of two levels, so
> it's not a generic solution.
>
> HTH
> Holger
>
>
> On 6/17/2014 0:25, amiika wrote:
>
> Hi,
>
> I tried to use semantic xml & sparql to transform legacy terminology to
> skos. Everything else worked fine except creating literals from mixed
> content.
>
> I have records such as:
>
> <record>
> <id>B34</id>
> <term>drinkable</term>
> <comment>For example <concept rel="#A123">water</concept> is <concept
> rel="#A344">liquid</concept> that is <concept
> rel="#B34">drinkable</concept></comment>
> </record>
>
> Creating skos concepts and adding relations is fairly easy from this
> format. However, creating literals from the comment element seems to be
> tricky. I tried to use group_concat, but ordering, spacing, commas etc.
> gets messed up. Any ideas how to do this other way?
>
> As a suggestion, this would be much easier if all elements with mixed
> content would also contain the flattened text.
>
> br,
> Miika
> --
> -- You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include Enterprise
> Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid
> Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
> To post to this group, send email to
> [email protected] <javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight,
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.