Examples

All the examples in this page use the the main schema.

Simple NIF annotation

Description

This example covers the basic example in the NIF documentation: http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core/nif-core.html.

Representation

{
    "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
    "@id": "me:Result1",
    "@type": "results",
    "activities": [ ],
    "entries": [
        {
            "@id": "http://example.org#char=0,40",
            "@type": [
                "nif:RFC5147String",
                "nif:Context"
            ],
            "nif:beginIndex": 0,
            "nif:endIndex": 40,
            "nif:isString": "My favourite actress is Natalie Portman"
        }
    ]
}

Sentiment Analysis

Description

This annotation corresponds to the sentiment analysis of an input. The example shows the sentiment represented according to Marl format. The sentiments detected are contained in the Sentiments array with their related part of the text.

Representation

{
  "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
  "@id": "me:Result1",
  "@type": "results",
  "activities": [
    {
      "@id": "_:SAnalysis1_Activity",
      "@type": "marl:SentimentAnalysis",
      "prov:wasAssociatedWith": "me:SAnalysis1"
    }
  ],
  "entries": [
    {
      "@id": "http://micro.blog/status1",
      "@type": [
        "nif:RFC5147String",
        "nif:Context"
      ],
      "nif:isString": "Dear Microsoft, put your Windows Phone on your newest #open technology program. You'll be awesome. #opensource",
      "sentiments": [
        {
          "@id": "http://micro.blog/status1#char=80,97",
          "nif:beginIndex": 80,
          "nif:endIndex": 97,
          "nif:anchorOf": "You'll be awesome.",
          "marl:hasPolarity": "marl:Positive",
          "marl:polarityValue": 0.9,
          "prov:wasGeneratedBy": "_:SAnalysis1_Activity"
        }
      ],
      "emotions": [
      ]
    }
  ]
}

Emotion Analysis

Description

This annotation represents the emotion analysis of an input to Senpy. The emotions are contained in the emotions section with the text that refers to following Onyx format and the emotion model defined beforehand.

Representation

{
  "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
  "@id": "me:Result1",
  "@type": "results",
  "activities": [
    {
      "@id": "me:EmotionAnalysis1_Activity",
      "@type": "me:EmotionAnalysis1",
      "prov:wasAssociatedWith": "me:EmotionAnalysis1"
    }
  ],
  "entries": [
    {
      "@id": "http://micro.blog/status1",
      "@type": [
        "nif:RFC5147String",
        "nif:Context"
      ],
      "nif:isString": "Dear Microsoft, put your Windows Phone on your newest #open technology program. You'll be awesome. #opensource",
      "sentiments": [
      ],
      "emotions": [
        {
          "@id": "http://micro.blog/status1#char=0,109",
          "nif:anchorOf": "Dear Microsoft, put your Windows Phone on your newest #open technology program. You'll be awesome. #opensource",
          "prov:wasGeneratedBy": "_:EmotionAnalysis1_Activity",
          "onyx:hasEmotion": [
            {
              "onyx:hasEmotionCategory": "wna:liking"
            },
            {
              "onyx:hasEmotionCategory": "wna:excitement"
            }
          ]
        }
      ]
    }
  ]
}