mirror of
https://github.com/gsi-upm/senpy
synced 2025-08-24 02:22:20 +00:00
Python 3 compatible
There are also some slight changes to the JSON schemas and the use of JSON-LD.
This commit is contained in:
4
senpy/schemas/analysis.json
Normal file
4
senpy/schemas/analysis.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/Analysis"
|
||||
}
|
33
senpy/schemas/context.jsonld
Normal file
33
senpy/schemas/context.jsonld
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"@vocab": "http://www.gsi.dit.upm.es/ontologies/senpy#",
|
||||
"dc": "http://dublincore.org/2012/06/14/dcelements#",
|
||||
"me": "http://www.mixedemotions-project.eu/ns/model#",
|
||||
"prov": "http://www.w3.org/ns/prov#",
|
||||
"nif": "http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#",
|
||||
"marl": "http://www.gsi.dit.upm.es/ontologies/marl/ns#",
|
||||
"onyx": "http://www.gsi.dit.upm.es/ontologies/onyx#",
|
||||
"wnaffect": "http://www.gsi.dit.upm.es/ontologies/wnaffect#",
|
||||
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
||||
"topics": {
|
||||
"@id": "dc:subject"
|
||||
},
|
||||
"entities": {
|
||||
"@id": "me:hasEntities"
|
||||
},
|
||||
"suggestions": {
|
||||
"@id": "me:hasSuggestions"
|
||||
},
|
||||
"emotions": {
|
||||
"@id": "onyx:hasEmotionSet"
|
||||
},
|
||||
"sentiments": {
|
||||
"@id": "marl:hasOpinion"
|
||||
},
|
||||
"entries": {
|
||||
"@id": "prov:used"
|
||||
},
|
||||
"analysis": {
|
||||
"@id": "prov:wasGeneratedBy"
|
||||
|
||||
}
|
||||
}
|
161
senpy/schemas/definitions.json
Normal file
161
senpy/schemas/definitions.json
Normal file
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"Results": {
|
||||
"title": "Results",
|
||||
"description": "The results of an analysis",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@context": {
|
||||
"$ref": "#/Context"
|
||||
},
|
||||
"@id": {
|
||||
"description": "ID of the analysis",
|
||||
"type": "string"
|
||||
},
|
||||
"analysis": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"$ref": "#/Analysis"
|
||||
}
|
||||
},
|
||||
"entries": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"$ref": "#/Entry"
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
"required": ["@id", "analysis", "entries"]
|
||||
},
|
||||
"Context": {
|
||||
"description": "JSON-LD Context",
|
||||
"type": ["array", "string", "object"]
|
||||
},
|
||||
"Analysis": {
|
||||
"description": "Senpy analysis",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@id": {
|
||||
"type": "string"
|
||||
},
|
||||
"@type": {
|
||||
"type": "string",
|
||||
"description": "Type of the analysis. e.g. marl:SentimentAnalysis"
|
||||
}
|
||||
},
|
||||
"required": ["@id", "@type"]
|
||||
},
|
||||
"Entry": {
|
||||
"properties": {
|
||||
"@id": {
|
||||
"type": "string"
|
||||
},
|
||||
"@type": {
|
||||
"enum": [["nif:RFC5147String", "nif:Context"]]
|
||||
},
|
||||
"nif:isString": {
|
||||
"description": "String contained in this Context",
|
||||
"type": "string"
|
||||
},
|
||||
"sentiments": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/Sentiment" }
|
||||
},
|
||||
"emotions": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/EmotionSet" }
|
||||
},
|
||||
"entities": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/Entity" }
|
||||
},
|
||||
"topics": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/Topic" }
|
||||
},
|
||||
"suggestions": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/Suggestion" }
|
||||
}
|
||||
},
|
||||
"required": ["@id", "nif:isString"]
|
||||
},
|
||||
"Sentiment": {
|
||||
"properties": {
|
||||
"@id": {"type": "string"},
|
||||
"nif:beginIndex": {"type": "integer"},
|
||||
"nif:endIndex": {"type": "integer"},
|
||||
"nif:anchorOf": {
|
||||
"description": "Piece of context that contains the Sentiment",
|
||||
"type": "string"
|
||||
},
|
||||
"marl:hasPolarity": {
|
||||
"enum": ["marl:Positive", "marl:Negative", "marl:Neutral"]
|
||||
},
|
||||
"marl:polarityValue": {
|
||||
"type": "number"
|
||||
},
|
||||
"prov:wasGeneratedBy": {
|
||||
"type": "string",
|
||||
"description": "The ID of the analysis that generated this Sentiment. The full object should be included in the \"analysis\" property of the root object"
|
||||
}
|
||||
},
|
||||
"required": ["@id", "prov:wasGeneratedBy"]
|
||||
},
|
||||
"EmotionSet": {
|
||||
"properties": {
|
||||
"@id": {"type": "string"},
|
||||
"nif:beginIndex": {"type": "integer"},
|
||||
"nif:endIndex": {"type": "integer"},
|
||||
"nif:anchorOf": {
|
||||
"description": "Piece of context that contains the Sentiment",
|
||||
"type": "string"
|
||||
},
|
||||
"onyx:hasEmotion": {
|
||||
"$ref": "#/Emotion"
|
||||
},
|
||||
"prov:wasGeneratedBy": {
|
||||
"type": "string",
|
||||
"description": "The ID of the analysis that generated this Emotion. The full object should be included in the \"analysis\" property of the root object"
|
||||
}
|
||||
},
|
||||
"required": ["@id", "prov:wasGeneratedBy", "onyx:hasEmotion"]
|
||||
},
|
||||
"Emotion": {
|
||||
"type": "object"
|
||||
},
|
||||
"Entity": {
|
||||
"type": "object"
|
||||
},
|
||||
"Topic": {
|
||||
"type": "object"
|
||||
},
|
||||
"Suggestion": {
|
||||
"type": "object"
|
||||
},
|
||||
"Plugins": {
|
||||
"properties": {
|
||||
"plugins": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/Plugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Plugin": {
|
||||
"type": "object",
|
||||
"required": ["@id"],
|
||||
"properties": {
|
||||
"@id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Response": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
4
senpy/schemas/emotion.json
Normal file
4
senpy/schemas/emotion.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/Emotion"
|
||||
}
|
4
senpy/schemas/emotionSet.json
Normal file
4
senpy/schemas/emotionSet.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/EmotionSet"
|
||||
}
|
4
senpy/schemas/entry.json
Normal file
4
senpy/schemas/entry.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/Entry"
|
||||
}
|
3
senpy/schemas/plugin.json
Normal file
3
senpy/schemas/plugin.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"$ref": "definitions.json#/Plugin"
|
||||
}
|
3
senpy/schemas/plugins.json
Normal file
3
senpy/schemas/plugins.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"$ref": "definitions.json#/Plugins"
|
||||
}
|
4
senpy/schemas/response.json
Normal file
4
senpy/schemas/response.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/Response"
|
||||
}
|
4
senpy/schemas/results.json
Normal file
4
senpy/schemas/results.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/Results"
|
||||
}
|
4
senpy/schemas/sentiment.json
Normal file
4
senpy/schemas/sentiment.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/Sentiment"
|
||||
}
|
4
senpy/schemas/suggestion.json
Normal file
4
senpy/schemas/suggestion.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$ref": "definitions.json#/Suggestion"
|
||||
}
|
Reference in New Issue
Block a user