@prefix this: . @prefix sub: . @prefix np: . @prefix dct: . @prefix nt: . @prefix npx: . @prefix xsd: . @prefix rdfs: . @prefix orcid: . @prefix prov: . @prefix foaf: . sub:Head { this: np:hasAssertion sub:assertion; np:hasProvenance sub:provenance; np:hasPublicationInfo sub:pubinfo; a np:Nanopublication . } sub:assertion { sub:paragraph a ; ; "Escaping in multi-value literal columns"; "

When concatenating literal values with a newline separator in group_concat, always escape existing backslashes and newlines in the individual values first: replace(replace(?val, \"\\\\\\\\\" , \"\\\\\\\\\\\\\\\\\"), \"\\\\n\", \"\\\\\\\\n\"). First escape existing backslashes (\\\\ → \\\\\\\\), then escape existing newlines (newline → \\\\n). This ensures values containing these characters can be safely split on newlines later.

"; "08" . } sub:provenance { sub:assertion prov:wasAttributedTo orcid:0000-0002-1267-0234 . } sub:pubinfo { orcid:0000-0002-1267-0234 foaf:name "Tobias Kuhn" . this: dct:created "2026-03-24T09:52:37Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:introduces sub:paragraph; rdfs:label "Escaping in multi-value literal columns"; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "ClvbVxqMFlyjYkKCcCgfuySwnZzcXFQbf6VOQARjz1JVd60Uc3bazfj+kOtM8hHuo+qRLyWAf1W1LESTGYauKE5M3KWYdhnb47eZI0tMWTZ9ftAcp9H3P7j7L34zO/aM2qzNK7GQcPTKpI9PfUyGpfKqbOgelth7gdKcE0nxat8="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }