Opened 10 years ago
Closed 9 years ago
#537 closed defect (wontfix)
Replacement of placeholder URLs
Reported by: | Olaf Seibert 1 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | DASISH backend |
Component: | DASISH backend | Version: | |
Keywords: | Cc: | olhsha |
Description
In the example at https://trac.clarin.eu/wiki/DASISH/XSD%20and%20XML#Makinganewannotation for posting a new annotation, there are placeholders for 3 things:
<annotation URI="xxx"
ownerRef="yyy">
and
<targetInfo ref="tmpTarget">
Below that, it is stated that "The temporary URIs/references are replaced with permanent references.".
I wasn't sure if this replacement happens only in those locations I show above, or throughout the body as well, so I tried the following. I use the placeholder URLs for target and annotation inside my body. I already know what my principal is so I don't use placeholders for that.
POST https://lux16.mpi.nl/ds/webannotator/api/annotations <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <annotation xmlns="http://www.dasish.eu/ns/addit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ownerRef="https://lux16.mpi.nl/ds/webannotator/api/principals/00000000-0000-0000-0000-000000000221" URI="__TEMP_ANNOTATION_REF__" xsi:schemaLocation="http://www.dasish.eu/ns/addit https://svn.clarin.eu/DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd"> <headline>new</headline> <lastModified>2014-04-24T12:46:44Z</lastModified> <body> <xmlBody> <mimeType>text/xml</mimeType> <ColTime xmlns:ns3="http://www.dasish.eu/ns/addit" xmlns="" ColTimeMessageID="3f5ea2c7-0f8b-49c0-bd43-5d80812aa75d" URL="__TEMP_ANNOTATION_REF__" noNamespaceSchemaLocation="http://www.mpi.nl/tools/elan/comments.xsd"> <Metadata> <Initials>OS</Initials> <Sender>sender@dom.ain</Sender> <Recipient>recei@pi.ent</Recipient> <CreationDate>2014-04-24T12:46:44Z</CreationDate> <ModificationDate>2014-04-24T12:46:44Z</ModificationDate> <Category>unknown</Category> <Status>unknown</Status> </Metadata> <MediaFile ColTimeID=""/> <AnnotationFile ColTimeID="__TEMP_TARGET_REF__" type="EAF">urn:nl-mpi-tools-elan-eaf:59d08e6a-5cd9-4aed-8aa4-7074c270e636#t=4.500/4.980;tier=Gloss_RH</AnnotationFile> <Message>new</Message> </ColTime> </xmlBody> </body> <targets> <targetInfo ref="__TEMP_TARGET_REF__"> <link>urn:nl-mpi-tools-elan-eaf:59d08e6a-5cd9-4aed-8aa4-7074c270e636</link> <version></version> </targetInfo> </targets> <permissions public="read"> <permission level="write" principalRef="https://lux16.mpi.nl/ds/webannotator/api/principals/00000000-0000-0000-0000-000000000221"/> </permissions> </annotation>
and I got back this:
<responseBody xmlns="http://www.dasish.eu/ns/addit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dasish.eu/ns/addit https://svn.clarin.eu/DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd"> <annotation URI="https://lux16.mpi.nl/ds/webannotator/api/annotations/dc95154f-4b54-4f81-909b-fee05aea1ee2" ownerRef="https://lux16.mpi.nl/ds/webannotator/api/principals/00000000-0000-0000-0000-000000000221"> <headline>new</headline> <lastModified>2014-04-24T12:46:44.692631Z</lastModified> <body> <xmlBody> <mimeType>text/xml</mimeType> <ColTime xmlns:ns3="http://www.dasish.eu/ns/addit" xmlns="" ColTimeMessageID="3f5ea2c7-0f8b-49c0-bd43-5d80812aa75d" URL="__TEMP_ANNOTATION_REF__" noNamespaceSchemaLocation="http://www.mpi.nl/tools/elan/comments.xsd"> <Metadata> <Initials>OS</Initials> <Sender>sender@dom.ain</Sender> <Recipient>recei@pi.ent</Recipient> <CreationDate>2014-04-24T12:46:44Z</CreationDate> <ModificationDate>2014-04-24T12:46:44Z</ModificationDate> <Category>unknown</Category> <Status>unknown</Status> </Metadata> <MediaFile ColTimeID=""/> <AnnotationFile ColTimeID="8f79c5ab-1bf4-484f-a9ad-48ec6d85c846" type="EAF">urn:nl-mpi-tools-elan-eaf:59d08e6a-5cd9-4aed-8aa4-7074c270e636#t=4.500/4.980;tier=Gloss_RH</AnnotationFile> <Message>new</Message> </ColTime> </xmlBody> </body> <targets> <targetInfo ref="https://lux16.mpi.nl/ds/webannotator/api/targets/8f79c5ab-1bf4-484f-a9ad-48ec6d85c846"> <link>urn:nl-mpi-tools-elan-eaf:59d08e6a-5cd9-4aed-8aa4-7074c270e636</link> <version></version> </targetInfo> </targets> <permissions public="read"> <permission principalRef="https://lux16.mpi.nl/ds/webannotator/api/principals/00000000-0000-0000-0000-000000000221" level="write"/> </permissions> </annotation> <actionList> <action> <object>https://lux16.mpi.nl/ds/webannotator/api/targets/8f79c5ab-1bf4-484f-a9ad-48ec6d85c846</object> <message>CREATE_CACHED_REPRESENTATION</message> </action> </actionList> </responseBody>
The interesting thing here is that ColTimeID="__TEMP_TARGET_REF__" has been replaced with ColTimeID="8f79c5ab-1bf4-484f-a9ad-48ec6d85c846" instead of with a full URL. The part you get does correspond with the last part of the URL.
Also URL="__TEMP_ANNOTATION_REF__" has been left unchanged.
For me it doesn't matter very much, because so far I have just filled in the correct values in those places when I retrieve the comment from the server, on the theory that at some point in the future it might be PUT back, including those corrected values.
I don't know if it was the intention to search/replace for all 3 of the placeholder URLs, but it would be cleaner for my case.
Change History (2)
comment:1 Changed 10 years ago by
Cc: | olhsha added |
---|
comment:2 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The project has ended.