Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotating text #30

Open
luigi-asprino opened this issue Jan 29, 2021 · 1 comment
Open

Annotating text #30

luigi-asprino opened this issue Jan 29, 2021 · 1 comment

Comments

@luigi-asprino
Copy link
Collaborator

Depends on

Independent

Description

Text annotators need a general schema for annotating words.

Source

WP3-WP6 working group

Competency Questions

  1. What is the entity denoted by a certain offset of a certain sentence?
  2. What is the part of a speech of a word?

Ontology/Ontology Design Patterns Relevant for the scenario

SPARQL Questions

CQ1:

PREFIX earmark: <http://www.essepuntato.it/2008/12/earmark#>
PREFIX semiotics: <http://ontologydesignpatterns.org/cp/owl/semiotics.owl#>

SELECT DISTINCT ?entity {
  ?pr earmark:begins ?beg .
  ?pr earmark:ends ?end .
  ?pr semiotics:denotes ?entity .
}

CQ2:

PREFIX earmark: <http://www.essepuntato.it/2008/12/earmark#>
PREFIX semiotics: <http://ontologydesignpatterns.org/cp/owl/semiotics.owl#>
PREFIX pos: <http://www.ontologydesignpatterns.org/ont/fred/pos.owl#> 

SELECT DISTINCT ?pos {
  ?pr earmark:begins ?beg .
  ?pr earmark:ends ?end .
  ?pr pos:pennpos ?pos .
}

Toy Dataset/SPARQL Endpoint

Example in TURTLE language

@prefix boxer: <http://www.ontologydesignpatterns.org/ont/boxer/boxer.owl#> .
@prefix ex:    <http://example.org/> .
@prefix pos:   <http://www.ontologydesignpatterns.org/ont/fred/pos.owl#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix dbr:   <http://dbpedia.org/resource/> .
@prefix earmark: <http://www.essepuntato.it/2008/12/earmark#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix DUL:   <http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#> .
@prefix semiotics: <http://ontologydesignpatterns.org/cp/owl/semiotics.owl#> .
@prefix wn30instances: <https://w3id.org/framester/wn/wn30/instances/> .

ex:offset_19_41_american_jazz_musician
        a                  earmark:PointerRange ;
        rdfs:label         "American Jazz Musician" ;
        semiotics:denotes  ex:AmericanJazzMusician ;
        earmark:begins     "19"^^xsd:nonNegativeInteger ;
        earmark:ends       "41"^^xsd:nonNegativeInteger ;
        earmark:refersTo   ex:docuverse .

ex:offset_0_11_Miles_Davis
        a                  earmark:PointerRange ;
        rdfs:label         "Miles Davis" ;
        semiotics:denotes  dbr:Miles_Davis ;
        earmark:begins     "0"^^xsd:nonNegativeInteger ;
        earmark:ends       "11"^^xsd:nonNegativeInteger ;
        earmark:refersTo   ex:docuverse ;
        pos:pennpos        pos:NNP .

ex:docuverse  a             earmark:StringDocuverse ;
        earmark:hasContent  "Miles Davis was an american jazz musician." .

ex:offset_19_27_american
        a                          earmark:PointerRange ;
        rdfs:label                 "american" ;
        semiotics:denotes          wn30instances:synset-American-adjective-1 ;
        earmark:begins             "19"^^xsd:nonNegativeInteger ;
        earmark:ends               "27"^^xsd:nonNegativeInteger ;
        earmark:refersTo           ex:docuverse ;
        pos:pennpos                pos:JJ .

ex:offset_33_41_musician
        a                  earmark:PointerRange ;
        rdfs:label         "musician" ;
        semiotics:denotes  dbr:Musician ;
        earmark:begins     "33"^^xsd:nonNegativeInteger ;
        earmark:ends       "41"^^xsd:nonNegativeInteger ;
        earmark:refersTo   ex:docuverse ;
        pos:pennpos        pos:NN .

ex:offset_28_32_jazz  a            earmark:PointerRange ;
        rdfs:label                 "jazz" ;
        semiotics:denotes          dbr:Jazz ;
        earmark:begins             "28"^^xsd:nonNegativeInteger ;
        earmark:ends               "32"^^xsd:nonNegativeInteger ;
        earmark:refersTo           ex:docuverse ;
        pos:pennpos                pos:NN .

Example in JSON-LD format

{
  "@context": {
    "ex": "http://example.org/",
    "pos": "http://www.ontologydesignpatterns.org/ont/fred/pos.owl#",
    "owl": "http://www.w3.org/2002/07/owl#",
    "dbr": "http://dbpedia.org/resource/",
    "earmark": "http://www.essepuntato.it/2008/12/earmark#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "DUL": "http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#",
    "semiotics": "http://ontologydesignpatterns.org/cp/owl/semiotics.owl#",
    "wn30instances": "https://w3id.org/framester/wn/wn30/instances/"
  },
  "@graph": [
    {
      "@id": "ex:docuverse",
      "@type": "earmark:StringDocuverse",
      "earmark:hasContent": "Miles Davis was an american jazz musician."
    },
    {
      "@id": "ex:offset_0_11_Miles_Davis",
      "@type": "earmark:PointerRange",
      "semiotics:denotes": {
        "@id": "dbr:Miles_Davis"
      },
      "earmark:begins": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "0"
      },
      "earmark:ends": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "11"
      },
      "earmark:refersTo": {
        "@id": "ex:docuverse"
      },
      "pos:pennpos": {
        "@id": "pos:NNP"
      },
      "rdfs:label": "Miles Davis"
    },
    {
      "@id": "ex:offset_19_27_american",
      "@type": "earmark:PointerRange",
      "semiotics:denotes": {
        "@id": "wn30instances:synset-American-adjective-1"
      },
      "earmark:begins": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "19"
      },
      "earmark:ends": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "27"
      },
      "earmark:refersTo": {
        "@id": "ex:docuverse"
      },
      "pos:pennpos": {
        "@id": "pos:JJ"
      },
      "rdfs:label": "american"
    },
    {
      "@id": "ex:offset_19_41_american_jazz_musician",
      "@type": "earmark:PointerRange",
      "semiotics:denotes": {
        "@id": "ex:AmericanJazzMusician"
      },
      "earmark:begins": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "19"
      },
      "earmark:ends": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "41"
      },
      "earmark:refersTo": {
        "@id": "ex:docuverse"
      },
      "rdfs:label": "American Jazz Musician"
    },
    {
      "@id": "ex:offset_28_32_jazz",
      "@type": "earmark:PointerRange",
      "semiotics:denotes": {
        "@id": "dbr:Jazz"
      },
      "earmark:begins": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "28"
      },
      "earmark:ends": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "32"
      },
      "earmark:refersTo": {
        "@id": "ex:docuverse"
      },
      "pos:pennpos": {
        "@id": "pos:NN"
      },
      "rdfs:label": "jazz"
    },
    {
      "@id": "ex:offset_33_41_musician",
      "@type": "earmark:PointerRange",
      "semiotics:denotes": {
        "@id": "dbr:Musician"
      },
      "earmark:begins": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "33"
      },
      "earmark:ends": {
        "@type": "xsd:nonNegativeInteger",
        "@value": "41"
      },
      "earmark:refersTo": {
        "@id": "ex:docuverse"
      },
      "pos:pennpos": {
        "@id": "pos:NN"
      },
      "rdfs:label": "musician"
    }
  ]
}
@alessioBosca
Copy link

alessioBosca commented Mar 16, 2021

@luigi-asprino Hi Luigi, after some exchanges with @marilenadaquino I was thinking of adding a few metadata in the response: a timestamp, the producer/source of the analysis and a collection (optional if provided in the input), I imagine as properties in the "earmark:StringDocuverse".
which annotations do you recommend to use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants