API
and Documentation
Reporter: Named Entity Web
Service API Documentation
For background, we suggest first reading the
about section for this Web
Service. Also, you may want to consult
this
document for an overall discussion of API design and philosophy.
Developers communicate with the
Reporter: Named Entity Zitgist UMBEL Web service using the HTTP GET method. You
may request one of the following mime types: (1)
text/xml,
(2)
application/rdf+xml and (3)
application/rdf+n3.
The content returned by the Web service will be serialized using the
mime type requested and the data returned will depend on the parameters
selected.
Web Service Endpoint
Information
Here is the information needed to communicate
with this Web service's endpoint. Descriptions of the parameters are
included below.
Note: if a parameter has a default value,
the requester can omit it and the default value will be used. Also,
some baseline UMBEL Web services may not offer other values than the
default.
HTTP
Method:
Possible "Accept:" HTTP header
field value:
URI:
- http://umbel.zitgist.com/ws/reporter/named_entity/
?mode=param1&source_named_entity=param2&lang=param3
URI dynamic parameters description:
Note: All parameters have to be URL-encoded
- param1. One or more of:
Note:
if more than one parameter is added,
the list is separated by a
semicolon ";"
- " pref_label (default)":
Include the preferred label
of the named entity
- " alt_label (default)": Include the alternative
label(s) of the
named entity
- " type (default)": Types of the named entity
- " parent_concept ": Include
the parent concepts of
the named entity
- " equivalent_other_class ": Include the external
classes equivalent to the named entity
- " broader_other_class ": Include external classes
super-class-of the named entity
- " named_entity ": References identical named entities
- param2. The URI
of a UMBEL named entity
- param3. One of:
- " en (default)": Labels of resultsets
in English if available
Example of Returned XML
Document
This is an example of the XML document returned by this
Web service endpoint for a given URI. This example returns a list of
properties' values for a given UMBEL named entity.
Query:
- http://umbel.zitgist.com/ws/reporter/named_entity/
?description=pref_label;alt_label
&source_named_entity=http://umbel.org/umbel/ne/wikipedia/Abraham_Lincoln
"Accept:" HTTP header field value::
Result:
-
<?xml version="1.0" encoding="utf-8"?>
-
<!DOCTYPE
resultset PUBLIC
"-//Zitgist LLC.//Infer Validator DTD 0.1//EN"
"http://umbel.zitgist.com/ws/dtd/reporter/named_entity.dtd">
-
<resultset>
-
<subject type="owl:Thing"
uri="http://umbel.org/umbel/ne/wikipedia/Abraham_Lincoln">
-
<predicate type="skos:prefLabel">
-
<object type="rdfs:Literal">Abraham
Lincoln</object>
-
</predicate>
-
<predicate type="skos:altLabel">
-
<object type="rdfs:Literal">16th
President of the United States
</object>
-
<object type="rdfs:Literal">A
Lincoln</object>
-
<object type="rdfs:Literal">A.
Lincoln</object>
-
<object type="rdfs:Literal">Abe
Lincoln</object>
-
<object type="rdfs:Literal">Abe
licnoln</object>
-
<object type="rdfs:Literal">Abe
lincolin</object>
-
<object type="rdfs:Literal">Abe
linlon</object>
-
<object type="rdfs:Literal">Abrahahm
lincon</object>
-
<object type="rdfs:Literal">Abraham
(president)</object>
-
<object type="rdfs:Literal">Abraham
Lincol</object>
-
<object type="rdfs:Literal">Abraham
Lincon</object>
-
<object type="rdfs:Literal">Abrahm
Lincoln</object>
-
<object type="rdfs:Literal">Great
Emancipator</object>
-
<object type="rdfs:Literal">Honest
Abe</object>
-
<object type="rdfs:Literal">King
Lincoln</object>
-
<object type="rdfs:Literal">Lincoln
Administration</object>
-
<object type="rdfs:Literal">Lincoln,
Abraham</object>
-
<object type="rdfs:Literal">Presedent
Lincon</object>
-
<object type="rdfs:Literal">Presidency
of Abraham Lincoln</object>
-
<object type="rdfs:Literal">President
Abraham Lincoln</object>
-
<object type="rdfs:Literal">President
Lincoln</object>
-
<object type="rdfs:Literal">Prince
of Rails</object>
-
<object type="rdfs:Literal">The
Great Emancipator</object>
-
<object type="rdfs:Literal">The
Rail Splitter</object>
-
</predicate>
-
</subject>
-
</resultset>
DTD of the XML
Document
-
<!DOCTYPE
resultset [
-
-
<!ELEMENT resultset (subject) >
-
-
<!ELEMENT subject (predicate)+>
-
<!ATTLIST subject type (owl:Thing) "owl:Thing">
-
<!ATTLIST subject uri CDATA
#IMPLIED>
-
-
<!ELEMENT predicate (object)+>
-
<!ATTLIST predicate type (skos:prefLabel | skos:altLabel
| rdf:type |
owl:sameAs) "skos:prefLabel">
-
-
<!ELEMENT object (#PCDATA)*>
-
<!ATTLIST object type (owl:Class | umbel:SubjectConcept
| owl:Thing
| rdf:Literal) "owl:Class">
-
<!ATTLIST object uri CDATA
#IMPLIED>
-
<!ATTLIST object label CDATA
#IMPLIED>
-
-
]>
Descriptions of the Types of XML Elements
Here are descriptions of the types
of XML elements that might be returned from from this Web
service. Please read the XML data structure documentation
to understand how the data is structured within these XML
documents.
- umbel:SubjectConcept (subject/object). An UMBEL subject concept
resource
returned by the Web service for the requested parameters
- owl:Class (subject/object).
A class defined in another
vocabulary than UMBEL
- rdfs:Literal (object). An object that defines a string literal
- owl:Thing (subject/concept).
A named entity
- skos:prefLabel (predicate). Defines the preferred label to refers to a
subject or an object
- skos:altLabel (predicate). Defines the alternative label(s) to refers
to a subject or an object
- rdf:type (predicate).
Defines the type(s) of a subject or an object
- owl:sameAs (predicate). Link a UMBEL named entity with another
identical
named entity
Example of Returned RDF/XML Document
Here is an example of a RDF/XML document returned by this Web service
endpoint for a given URI. This example returns a list of properties'
values for a given UMBEL named entity.
Query:
- http://umbel.zitgist.com/ws/reporter/named_entity/
?description=pref_label;alt_label
&source_named_entity=http://umbel.org/umbel/ne/wikipedia/Abraham_Lincoln
"Accept:" HTTP header field value:
Result:
-
<?xml version="1.0"?>
-
<rdf:RDF
xmlns:umbel="http://umbel.org/umbel#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2008/05/skos#">
-
-
<owl:Thing rdf:about="http://umbel.org/umbel/ne/wikipedia/Abraham_Lincoln">
-
<skos:prefLabel>Abraham
Lincoln</skos:prefLabel>
-
<skos:altLabel>16th
President of the United States</skos:altLabel>
-
<skos:altLabel>A
Lincoln</skos:altLabel>
-
<skos:altLabel>A.
Lincoln</skos:altLabel>
-
<skos:altLabel>Abe
Lincoln</skos:altLabel>
-
<skos:altLabel>Abe
licnoln</skos:altLabel>
-
<skos:altLabel>Abe
lincolin</skos:altLabel>
-
<skos:altLabel>Abe
linlon</skos:altLabel>
-
<skos:altLabel>Abrahahm
lincon</skos:altLabel>
-
<skos:altLabel>Abraham
(president)</skos:altLabel>
-
<skos:altLabel>Abraham
Lincol</skos:altLabel>
-
<skos:altLabel>Abraham
Lincon</skos:altLabel>
-
<skos:altLabel>Abrahm
Lincoln</skos:altLabel>
-
<skos:altLabel>Great
Emancipator</skos:altLabel>
-
<skos:altLabel>Honest
Abe</skos:altLabel>
-
<skos:altLabel>King
Lincoln</skos:altLabel>
-
<skos:altLabel>Lincoln
Administration</skos:altLabel>
-
<skos:altLabel>Lincoln,
Abraham</skos:altLabel>
-
<skos:altLabel>Presedent
Lincon</skos:altLabel>
-
<skos:altLabel>Presidency
of Abraham Lincoln</skos:altLabel>
-
<skos:altLabel>President
Abraham Lincoln</skos:altLabel>
-
<skos:altLabel>President
Lincoln</skos:altLabel>
-
<skos:altLabel>Prince
of Rails</skos:altLabel>
-
<skos:altLabel>The
Great Emancipator</skos:altLabel>
-
<skos:altLabel>The
Rail Splitter</skos:altLabel>
-
</owl:Thing>
-
-
</rdf:RDF>
Example
of Returned RDF/N3 Document
Here is an example of a RDF/N3
document returned by this Web service endpoint for a given URI. This
example returns a list of properties' values for a given UMBEL named
entity.
Query:
- http://umbel.zitgist.com/ws/reporter/subject_concept/
?description=pref_label;alt_label
&source_subject_concept=http://umbel.org/umbel/sc/Person
"Accept:" HTTP header field value:
Result:
-
@prefix rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
@prefix rdfs:
<http://www.w3.org/2000/01/rdf-schema#> .
-
@prefix owl:
<http://www.w3.org/2002/07/owl#> .
-
@prefix umbel:
<http://umbel.org/umbel#> .
-
@prefix skos:
<http://www.w3.org/2008/05/skos#> .
-
<http://umbel.org/umbel/ne/wikipedia/Abraham_Lincoln>
a owl:Thing ;
-
skos:prefLabel
"""Abraham Lincoln""" ;
-
skos:altLabel """16th
President of the United States""" ;
-
skos:altLabel """A
Lincoln""" ;
-
skos:altLabel """A.
Lincoln""" ;
-
skos:altLabel """Abe
Lincoln""" ;
-
skos:altLabel """Abe
licnoln""" ;
-
skos:altLabel """Abe
lincolin""" ;
-
skos:altLabel """Abe
linlon""" ;
-
skos:altLabel
"""Abrahahm lincon""" ;
-
skos:altLabel """Abraham
(president)""" ;
-
skos:altLabel """Abraham
Lincol""" ;
-
skos:altLabel """Abraham
Lincon""" ;
-
skos:altLabel """Abrahm
Lincoln""" ;
-
skos:altLabel """Great
Emancipator""" ;
-
skos:altLabel """Honest
Abe""" ;
-
skos:altLabel """King
Lincoln""" ;
-
skos:altLabel """Lincoln
Administration""" ;
-
skos:altLabel
"""Lincoln, Abraham""" ;
-
skos:altLabel
"""Presedent Lincon""" ;
-
skos:altLabel
"""Presidency of Abraham Lincoln""" ;
-
skos:altLabel
"""President Abraham Lincoln""" ;
-
skos:altLabel
"""President Lincoln""" ;
-
skos:altLabel """Prince
of Rails""" ;
-
skos:altLabel """The
Great Emancipator""" ;
-
skos:altLabel """The
Rail Splitter""" .
HTTP
Status Codes
Here are the possible HTTP status (error)
codes returned by this Web service endpoint.
- Code: 200
- Code: 400
- Message: Bad Request
- Message description: No source
named entity
- Code: 406
- Message: Not Acceptable
- Message description: Unacceptable mime type requested
- Code: 500