Skip to content

POST annotationset

Paolo Ciccarese edited this page Jul 11, 2014 · 19 revisions

POST /annotationset/

Creates a new Annotation Set.

Parameter Description Default Impl
apiKey The application assigned apikey. The API calls are available only for registered and authorized applications. REQUIRED YES
set The Annotation Set content REQUIRED YES
outCmd This determines the kind of JSON-LD post processing before the saved objects are returned to the client. Possible values are 'none', 'context', 'frame'. The framing algorithm is currently not supporting Named Graphs* and therefore 'frame' is currently incompatible with 'incGph' set to 'true' none yes
validate If 'ON' the software will go through the appropriate validation algorithm before being stored OFF no
flavor If specified, this will influence the validation process. OA no

Where OA is Open Annotation Model.

Results format

curl -i -X POST http://localhost:8080/s/annotationset \
-H "Content-Type: application/json" \
-d'{"apiKey":"testkey","set":{"@context":"https://raw2.github.com/Annotopia/AtSmartStorage/master/web-app/data/AnnotopiaContext.json","@id":"urn:temp:1","@type":"at:AnnotationSet","label":"Default Set","description":"The default set is created automatically by Domeo when no other set is existing.","createdBy":{"@id":"urn:person:uuid:8a70343d3ec28b86013ec28bd4bc0000","@type": "foaf:Person","foaf:name":"Jon Setter"},"createdAt":"2014-02-17T09:46:11-5000","createdWith":{"@id":"urn:dome:software:id:Domeo-2.0alpha-020","@type":"prov:SoftwareAgent","foaf:name":"Domeo"},"annotations":[{"@id":"urn:temp:7","@type":"oa:Annotation","motivatedBy":"oa:commenting","annotatedBy":{"@id":"http://orcid.org/0000-0002-5156-2703","@type":"foaf:Person","foaf:name":"Paolo Ciccarese"},"annotatedAt":"2014-02-17T09:46:11-5000","serializedBy":"urn:application:domeo","serializedAt":"2014-02-17T09:46:51-5000","hasBody":[{"@type":["cnt:ContentAsText","dctypes:Text"],"cnt:chars":"This is Paolo Ciccarese CV","dc:format":"text/plain"}],"hasTarget":[{"@id":"urn:temp:8","@type":"oa:SpecificResource","hasSelector":{"@type":"oa:TextQuoteSelector","exact":"senior scientist and software engineer","prefix":"I am a","suffix":", working in the bio-medical informatics field since the year 2000"},"hasSource":{"@id":"http://paolociccarese.info","@type":"dctypes:Text"}}]},{"@id":"urn:temp:3","@type":"oa:Annotation","hasBody":[{"@type":["cnt:ContentAsText","dctypes:Text"],"cnt:chars":"This is Paolo Ciccarese homepage","dc:format":"text/plain"}],"motivatedBy":"oa:commenting","annotatedBy":{"@id":"http://orcid.org/0000-0002-5156-2703","@type":"foaf:Person","foaf:name":"Paolo Ciccarese"},"annotatedAt":"2014-02-17T09:46:11-5000","serializedBy":"urn:application:domeo","serializedAt":"2014-02-17T09:46:51-5000","hasTarget":[{"@id":"urn:temp:4","@type":"oa:SpecificResource","hasSelector":{"@type":"oa:TextQuoteSelector","exact":"senior scientist and software engineer","prefix":"I am a","suffix":", working in the bio-medical informatics field since the year 2000"},"hasSource":{"@id":"http://paolociccarese.info","@type":"dctypes:Text"}}]}]}}'

The content is:

{
"apiKey": "testkey",
"set": {
    "@context": "https://raw2.github.com/Annotopia/AtSmartStorage/master/web-app/data/AnnotopiaContext.json",
    "@id": "urn:temp:1",
    "@type": "at:AnnotationSet",
    "label": "Default Set",
    "description": "The default set is created automatically by Domeo when no other set is existing.",
    "createdBy": {
        "@id": "urn:person:uuid:8a70343d3ec28b86013ec28bd4bc0000",
        "@type": "foaf:Person",
        "foaf:name": "Jon Setter"
    },
    "createdAt": "2014-02-17T09:46:11-5000",
    "createdWith": {
        "@id": "urn:dome:software:id:Domeo-2.0alpha-020",
        "@type": "prov:SoftwareAgent",
        "foaf:name": "Domeo"
    },
    "annotations": [
        {
            "@id": "urn:temp:7",
            "@type": "oa:Annotation",
            "motivatedBy": "oa:commenting",
            "annotatedBy": {
                "@id": "http://orcid.org/0000-0002-5156-2703",
                "@type": "foaf:Person",
                "foaf:name": "Paolo Ciccarese"
            },
            "annotatedAt": "2014-02-17T09:46:11-5000",
            "serializedBy": "urn:application:domeo",
            "serializedAt": "2014-02-17T09:46:51-5000",
            "hasBody": [
                {
                    "@type": [
                        "cnt:ContentAsText",
                        "dctypes:Text"
                    ],
                    "cnt:chars": "This is Paolo Ciccarese CV",
                    "dc:format": "text/plain"
                }
            ],
            "hasTarget": [
                {
                    "@id": "urn:temp:8",
                    "@type": "oa:SpecificResource",
                    "hasSelector": {
                        "@type": "oa:TextQuoteSelector",
                        "exact": "senior scientist and software engineer",
                        "prefix": "I am a",
                        "suffix": ", working in the bio-medical informatics field since the year 2000"
                    },
                    "hasSource": {
                        "@id": "http://paolociccarese.info",
                        "@type": "dctypes:Text"
                    }
                }
            ]
        },
        {
            "@id": "urn:temp:3",
            "@type": "oa:Annotation",
            "hasBody": [
                {
                    "@type": [
                        "cnt:ContentAsText",
                        "dctypes:Text"
                    ],
                    "cnt:chars": "This is Paolo Ciccarese homepage",
                    "dc:format": "text/plain"
                }
            ],
            "motivatedBy": "oa:commenting",
            "annotatedBy": {
                "@id": "http://orcid.org/0000-0002-5156-2703",
                "@type": "foaf:Person",
                "foaf:name": "Paolo Ciccarese"
            },
            "annotatedAt": "2014-02-17T09:46:11-5000",
            "serializedBy": "urn:application:domeo",
            "serializedAt": "2014-02-17T09:46:51-5000",
            "hasTarget": [
                {
                    "@id": "urn:temp:4",
                    "@type": "oa:SpecificResource",
                    "hasSelector": {
                        "@type": "oa:TextQuoteSelector",
                        "exact": "senior scientist and software engineer",
                        "prefix": "I am a",
                        "suffix": ", working in the bio-medical informatics field since the year 2000"
                    },
                    "hasSource": {
                        "@id": "http://paolociccarese.info",
                        "@type": "dctypes:Text"
                    }
                }
            ]
        }
    ]
}
}

No content

{
    "status":"nocontent",
    "duration":"1ms",
    "message":"The request does not carry the payload or payload cannot be read"
}

--

curl -i -X POST http://localhost:8090/s/annotationset -H "Content-Type: application/json" -d'{"apiKey":"df468dae-2f38-4a2b-86be-7924dda2898f","set":{"@context":"https://raw2.github.com/Annotopia/AtSmartStorage/master/web-app/data/AnnotopiaContext.json","@id":"urn:temp:1","@type":"at:AnnotationSet","label":"Default Set","description":"The default set is created automatically by Domeo when no other set is existing.","createdBy":{"@id":"urn:person:uuid:8a70343d3ec28b86013ec28bd4bc0000","@type":"foaf:Person","foaf:name":"Jon Setter"},"createdAt":"2014-02-17T09:46:11-5000","createdWith":{"@id":"urn:dome:software:id:Domeo-2.0alpha-020","@type":"prov:SoftwareAgent","foaf:name":"Domeo"},"annotations":[{"@id":"urn:temp:7","@type":"oa:Annotation","motivatedBy":"oa:commenting","annotatedBy":{"@id":"http://orcid.org/0000-0002-5156-2703","@type":"foaf:Person","foaf:name":"Paolo Ciccarese"},"annotatedAt":"2014-02-17T09:46:11-5000","serializedBy":"urn:application:domeo","serializedAt":"2014-02-17T09:46:51-5000","hasBody":[{"@type":["cnt:ContentAsText","dctypes:Text"],"cnt:chars":"This is Paolo Ciccarese CV","dc:format":"text/plain"}],"hasTarget":[{"@id":"urn:temp:8","@type":"oa:SpecificResource","hasSelector":{"@type":"oa:TextQuoteSelector","exact":"senior scientist and software engineer","prefix":"I am a","suffix":", working in the bio-medical informatics field since the year 2000"},"hasSource":{"@id":"http://paolociccarese.info","@type":"dctypes:Text"}}]},{"@id":"urn:temp:3","@type":"oa:Annotation","hasBody":[{"@type":["cnt:ContentAsText","dctypes:Text"],"cnt:chars":"This is Paolo Ciccarese homepage","dc:format":"text/plain"}],"motivatedBy":"oa:commenting","annotatedBy":{"@id":"http://orcid.org/0000-0002-5156-2703","@type":"foaf:Person","foaf:name":"Paolo Ciccarese"},"annotatedAt":"2014-02-17T09:46:11-5000","serializedBy":"urn:application:domeo","serializedAt":"2014-02-17T09:46:51-5000","hasTarget":[{"@id":"urn:temp:4","@type":"oa:SpecificResource","hasSelector":{"@type":"oa:TextQuoteSelector","exact":"senior scientist and software engineer","prefix":"I am a","suffix":", working in the bio-medical informatics field since the year 2000"},"hasSource":{"@id":"http://paolociccarese.info","@type":"dctypes:Text","http://purl.org/vocab/frbr/core#embodimentOf":{"http://prismstandard.org/namespaces/basic/2.0/doi":"10.1186/2041-1480-2-S2-S2","http://purl.org/spar/fabio#hasPII":"2041-1480-2-S2-S2","http://purl.org/spar/fabio#hasPubMedCentralId":"PMC3102894","http://purl.org/spar/fabio#hasPubMedId":"21624158"}}}]}]}}'