Examples

All the examples in this page use the schema defined in Schemas and formats.

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": "http://example.com#NIFExample",
  "analysis": [
  ],
  "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

Representation

{
  "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
  "@id": "me:Result1",
  "analysis": [
    {
      "@id": "me:SAnalysis1",
      "@type": "marl:SentimentAnalysis",
      "marl:maxPolarityValue": 1,
      "marl:minPolarityValue": 0
    }
  ],
  "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",
      "entities": [
      ],
      "suggestions": [
      ],
      "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": "me:SAnalysis1"
        }
      ],
      "emotionSets": [
      ]
    }
  ]
}

Suggestion Mining

Description

Representation

{
  "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
  "@id": "me:Result1",
  "analysis": [
    {
      "@id": "me:SgAnalysis1",
      "@type": "me:SuggestionAnalysis"
    }
  ],
  "entries": [
    {
      "@id": "http://micro.blog/status1",
      "@type": [
        "nif:RFC5147String",
        "nif:Context"
      ],
      "prov:wasGeneratedBy": "me:SAnalysis1",
      "nif:isString": "Dear Microsoft, put your Windows Phone on your newest #open technology program. You'll be awesome. #opensource",
      "entities": [
      ],
      "suggestions": [
        {
          "@id": "http://micro.blog/status1#char=16,77",
          "nif:beginIndex": 16,
          "nif:endIndex": 77,
          "nif:anchorOf": "put your Windows Phone on your newest #open technology program"
        }
      ],
      "sentiments": [
      ],
      "emotionSets": [
      ]
    }
  ]
}

Emotion Analysis

Description

Representation

{
  "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
  "@id": "me:Result1",
  "analysis": [
    {
      "@id": "me:EmotionAnalysis1",
      "@type": "onyx:EmotionAnalysis"
    }
  ],
  "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",
      "entities": [
      ],
      "suggestions": [
      ],
      "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": "me:EmotionAnalysis1",
          "onyx:hasEmotion": [
            {
              "onyx:hasEmotionCategory": "wna:liking"
            },
            {
              "onyx:hasEmotionCategory": "wna:excitement"
            }
          ]
        }
      ]
    }
  ]
}

Named Entity Recognition

Description

Representation

{
  "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
  "@id": "me:Result1",
  "analysis": [
    {
      "@id": "me:NER1",
      "@type": "me:NERAnalysis"
    }
  ],
  "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",
      "entities": [
        {
          "@id": "http://micro.blog/status1#char=5,13",
          "nif:beginIndex": 5,
          "nif:endIndex": 13,
          "nif:anchorOf": "Microsoft",
          "me:references": "http://dbpedia.org/page/Microsoft",
          "prov:wasGeneratedBy": "me:NER1"
        },
        {
          "@id": "http://micro.blog/status1#char=25,37",
          "nif:beginIndex": 25,
          "nif:endIndex": 37,
          "nif:anchorOf": "Windows Phone",
          "me:references": "http://dbpedia.org/page/Windows_Phone",
          "prov:wasGeneratedBy": "me:NER1"
        }
      ],
      "suggestions": [
      ],
      "sentiments": [
      ],
      "emotionSets": [
      ]
    }
  ]
}

Complete example

Description

This example covers all of the above cases, integrating all the annotations in the same document.

Representation

{
  "@context": "http://mixedemotions-project.eu/ns/context.jsonld",
  "@id": "me:Result1",
  "analysis": [
    {
      "@id": "me:SAnalysis1",
      "@type": "marl:SentimentAnalysis",
      "marl:maxPolarityValue": 1,
      "marl:minPolarityValue": 0
    },
    {
      "@id": "me:SgAnalysis1",
      "@type": "me:SuggestionAnalysis"
    },
    {
      "@id": "me:EmotionAnalysis1",
      "@type": "me:EmotionAnalysis"
    },
    {
      "@id": "me:NER1",
      "@type": "me:NER"
    }
  ],
  "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",
      "entities": [
        {
          "@id": "http://micro.blog/status1#char=5,13",
          "nif:beginIndex": 5,
          "nif:endIndex": 13,
          "nif:anchorOf": "Microsoft",
          "me:references": "http://dbpedia.org/page/Microsoft",
          "prov:wasGeneratedBy": "me:NER1"
        },
        {
          "@id": "http://micro.blog/status1#char=25,37",
          "nif:beginIndex": 25,
          "nif:endIndex": 37,
          "nif:anchorOf": "Windows Phone",
          "me:references": "http://dbpedia.org/page/Windows_Phone",
          "prov:wasGeneratedBy": "me:NER1"
        }
      ],
      "suggestions": [
        {
          "@id": "http://micro.blog/status1#char=16,77",
          "nif:beginIndex": 16,
          "nif:endIndex": 77,
          "nif:anchorOf": "put your Windows Phone on your newest #open technology program"
        }
      ],
      "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": "me:SAnalysis1"
        }
      ],
      "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": "me:EAnalysis1",
          "onyx:hasEmotion": [
            {
              "onyx:hasEmotionCategory": "wna:liking"
            },
            {
              "onyx:hasEmotionCategory": "wna:excitement"
            }
          ]
        }
      ]
    }
  ]
}