3-Round-Stones / callimachus

Callimachus is a highly scalable platform for creating and running data-driven websites
Other
95 stars 24 forks source link

Editing RewriteRule with multiline template is not possible #256

Open edwardsph opened 8 years ago

edwardsph commented 8 years ago

If a template has a header defined e.g.

/usepa/app/pipelines/company-data.xpl?results&id={id}
Accept: application/rdf+xml

When it is loaded back into the edit page, the newline becomes a space. Even if you correct this and try and save it again you can't because the SPARQL is built around the corrupted string:

PREFIX dc:<http://purl.org/dc/terms/>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>

DELETE WHERE {
    <https://usepa.3roundstones.net/usepa/app/purls/company-rewrite>
        calli:copy "^[^\\?]+\\?id=.*$ /usepa/app/pipelines/company-data.xpl?results&id={id} Accept: application/rdf+xml".
};
INSERT {
    <https://usepa.3roundstones.net/usepa/app/purls/company-rewrite>
        calli:copy """^\\?id=.*$ /usepa/app/pipelines/company-data.xpl?results&id={id}
Accept: application/rdf+xml""";
        dc:modified "2016-06-08T14:36:36.286Z"^^xsd:dateTime.
}
WHERE {
};

Giving the error:

Triple 
/usepa/app/purls/company-rewrite
/rdf/2009/framework#copy
"^[^\?]+\?id=.*$ /usepa/app/pipelines/company-data.xpl?results&id={id} Accept: application/rdf+xml"^^</2001/XMLSchema#string> 
must match one of 
[
</usepa/app/purls/company-rewrite>
</rdf/2009/framework#copy>
"^[^\\?]+\\?id=.*$ /usepa/app/pipelines/company-data.xpl?results&id={id}\nAccept: application/rdf+xml"^^</2001/XMLSchema#string>
]