Sign in

Working

Register

Working

Working

RESTful Web APIs allow clients to interact with remote servers using HTTP GET, PUT, POST and DELETE methods. They are usually consumed by AJAX clients but in theory any HTTP client can access them. linkedarc.net provides a Web API interface to its data. This section documents this API and gives some brief examples about how it might be used.

The linkedarc.net Web API URL format

The basic format for all linkedarc.net Web API calls is shown below.

http://linkedarc.net/ws/query?request=[REQUEST]

[REQUEST] is replaced with the method name and depending on the method this can be followed by one or more additional parameters. A simple example Here is a very simple example call to the linkedarc.net Web API. It asks for all of the datatables that are associated with the la_pp project.

http://linkedarc.net/ws/query?request=datatablelist&project=la_pp

The method requested is datatablelist and it is passed a single additional parameter. This parameter’s name is project and its value is la_pp. Notice how parameters are separated by an ampersand character. While not an issue in this case, values that contain special characters such as forward or backslashes need to be encoded before being attached to the request URL.

Data is returned from all of the linkedarc.net Web API methods as a JSON-encoded string. Here is a sample return for the call shown above.

{
    "pDataTables": [
        {
            "szDescription": "The catalogued objects table holds the records that describe all of the small finds that have been catalogued by the project team.",
            "szDisplayName": "Catalogued objects",
            "records-ontology-classname": "http://linkedarc.net/ontology/la_pp/LA_E6_CataloguedObject",
            "uri": "la_pp:datatable0",
            "szName": "catobj",
            "nRecordCount": "2384",
            "uri_base": "http://linkedarc.net/data/la_pp/catobj"
        },
        {
            "szDescription": "The contexts table holds the records that describe all of the contexts that were excavated at Priniatikos Pyrgos.",
            "szDisplayName": "Contexts",
            "records-ontology-classname": "http://purl.org/crmeh#EHE0007_Context",
            "uri": "la_pp:datatable1",
            "szName": "contexts",
            "nRecordCount": "688",
            "uri_base": "http://linkedarc.net/data/la_pp/context"
        }
]
}

The Web API methods

http://linkedarc.net/ws/query?request=projectlist

DescriptionGet a list of all the linkedarc.net projects.
Parameters

Sample return

{
    "pProjects": [
        {
            "geolocation": {
                "lat": 35.1284,
                "lng": 25.7314
            },
            "display_name": "Priniatikos Pyrgos",
            "description": "Priniatikos Pyrgos is an archaeological site near Istron River, in the eastern Cretan regional unit of Lasithi, (Greece). ",
            "image_map_src": "http://linkedarc.net/img/pp_thumbnail.jpg",
            "creator": "flynam",
            "uri": "http://linkedarc.net/data/project0",
            "db_name": "la_pp",
            "ontology_url": "la:la_pp",
            "date_created": "2014-10-28"
        }
    ]
}

http://linkedarc.net/ws/query?request=projectontologyurl&project=[PROJECT_ID]

DescriptionGet the URL of the ontology file for the linkedarc.net project.
Parameters
namedescriptiontype
projectProject ID stringstring

Sample return

{
    "szURL": http://linkedarc.net/ontology/la_pp
}

http://linkedarc.net/ws/query?request=datatablelist&project=[PROJECT_ID]

DescriptionGet a list of all the datatables in the linkedarc.net project.
Parameters
namedescriptiontype
projectProject ID stringstring

Sample return

{
    "pDataTables": [
        {
            "szDescription": "The catalogued objects table holds the records that describe all of the small finds that have been catalogued by the project team.",
            "szDisplayName": "Catalogued objects",
            "records-ontology-classname": "http://linkedarc.net/ontology/la_pp/LA_E6_CataloguedObject",
            "uri": "la_pp:datatable0",
            "szName": "catobj",
            "nRecordCount": "2384",
            "uri_base": "http://linkedarc.net/data/la_pp/catobj"
        },
        {
            "szDescription": "The contexts table holds the records that describe all of the contexts that were excavated at Priniatikos Pyrgos.",
            "szDisplayName": "Contexts",
            "records-ontology-classname": "http://purl.org/crmeh#EHE0007_Context",
            "uri": "la_pp:datatable1",
            "szName": "contexts",
            "nRecordCount": "688",
            "uri_base": "http://linkedarc.net/data/la_pp/context"
        }
]
}

http://linkedarc.net/ws/query?request=projectontologyurl&project=[PROJECT_ID]

DescriptionGet the URL of the ontology file for the linkedarc.net project.
Parameters
namedescriptiontype
projectProject ID stringstring

Sample return

{
    "szURL": http://linkedarc.net/ontology/la_pp
}

http://linkedarc.net/ws/query?request=datatableinfo&project=[PROJECT_ID]&datatable=[DATATABLE_ID]

DescriptionGet details about a datatable in a linkedarc.net project.
Parameters
namedescriptiontype
projectProject ID stringstring
datatableDatatable ID stringstring

Sample return

{
    "pDataTable": {
        "szDescription": "The contexts table holds the records that describe all of the contexts that were excavated at Priniatikos Pyrgos.",
        "szDisplayName": "Contexts",
        "records-ontology-classname": "http://purl.org/crmeh#EHE0007_Context",
        "uri": "la_pp:datatable1",
        "szName": "contexts",
        "nRecordCount": "688",
        "uri_base": "http://linkedarc.net/data/la_pp/context"
    }
}

http://linkedarc.net/ws/query?request=recordlisthtml &project=[PROJECT_ID]&datatable=[DATATABLE_ID]&range_from=[RECORD_INDEX_START]&range_to=[ RECORD_INDEX_END]

DescriptionGet HTML that lists certain values in a range of datatable records. Note that linkedarc.net creates this HTML document using a schema for the requested datatable that contains predicate value placeholders.
Parameters
namedescriptiontype
projectProject ID stringstring
datatableDatatable ID stringstring
range_fromThe start record indexinteger
range_toThe end record indexinteger

Sample return

<table id="browse_record_results" class="table">
    <tr class="title"><td>Record ID</td><td>Trench</td><td>Type</td><td>Description</td></tr>
    <tr>
        <td><a id="browse_records_item_view_1" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=1">1</a></td>
        <td><a id="browse_records_item_view_1" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=1">2</a></td>
        <td><a id="browse_records_item_view_1" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=1">http://linkedarc.net/data/la_pp/contexttype-deposit</a></td>
        <td><a id="browse_records_item_view_1" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=1">Topsoil</a></td>
    <tr><tr>
        <td><a id="browse_records_item_view_10" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=10">10</a></td>
        <td><a id="browse_records_item_view_10" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=10">2</a></td>
        <td><a id="browse_records_item_view_10" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=10"></a></td>
        <td><a id="browse_records_item_view_10" class="browse_records_item_view" href="project_datatable_record.php?project=la_pp&datatable=contexts&record_id=10">an area of rock tumble </a></td>
    <tr><tr>
</table>

http://linkedarc.net/ws/query?request=recordhtml&project=[PROJECT_ID]&datatable=[DATATABLE_ID]&record_id=[ RECORD_ID]

DescriptionGet the HTML that is filled in with values linked to the requested datatable record. Note that linkedarc.net creates this HTML document using a schema for the requested datatable that contains predicate value placeholders.
Parameters
namedescriptiontype
projectProject ID stringstring
datatableDatatable ID stringstring
record_idRecord ID stringstring

Sample return

<div itemscope itemtype="http://schema.org/Thing">
<ul class="nav nav-tabs">
  <li class="active"><a href="#">General</a></li>
  <li><a href="#">Geo</a></li>
  <li><a href="#">Deposit</a></li>
  <li><a href="#">Uncatalogued finds</a></li>
  <li><a href="#">Sub-contexts</a></li>
  <li><a href="#">Cut</a></li>
  <li><a href="#">Masonry</a></li>
  <li><a href="#">Catalogue</a></li>
  <li><a href="#">Images</a></li>
</ul>
<div id="tabs-0" class="nav-tab">
  <table id="record_item">
      <tr>
          <td class="record_var"><a href="http://erlangen-crm.org/current/P89_falls_within" target="_blank">Trench</a></td>
          <td class="gap"></td>
          <td class="record_value" data-rdf-predicate="http://erlangen-crm.org/current/P89_falls_within:http://erlangen-crm.org/current/P87_is_identified_by" data-rdf-object="http://linkedarc.net/data/la_pp/trench2" data-rdf-objecttype="http://www.w3.org/2001/XMLSchema#string" data-rdf-options="edit">
          	<div itemscope itemtype ="http://schema.org/Thing/Archaeology/Trench">
          		<span itemprop="name">
	              <a href="/projects/project_datatable_record.php?project=la_pp&datatable=trenches&record_id=2">2</a>
          		</span>
          	</div>
          </td>
      </tr>
      <tr>
          <td class="record_var"><a href="http://erlangen-crm.org/current/P2_has_type" target="_blank">Type</a></td>
          <td class="gap"></td>
          <td class="record_value" data-rdf-predicate="http://erlangen-crm.org/current/P2_has_type" data-rdf-object="http://linkedarc.net/data/la_pp/contexttype-deposit" data-rdf-objecttype="http://erlangen-crm.org/current/E55_Type" data-rdf-options="edit">http://linkedarc.net/data/la_pp/contexttype-deposit</td>
      </tr>
      <tr>
          <td class="record_var"><a href="http://erlangen-crm.org/current/P7i_witnessed:http://erlangen-crm.org/current/P3_has_note" target="_blank">Description</a></td>
          <td class="gap"></td>
          <td class="record_value" data-rdf-predicate="http://erlangen-crm.org/current/P7i_witnessed:http://erlangen-crm.org/current/P3_has_note" data-rdf-object="Topsoil" data-rdf-objecttag="description" data-rdf-objecttype="http://www.w3.org/2001/XMLSchema#string" data-rdf-options="edit">Topsoil</td>
      </tr>
      <tr>
          <td class="record_var"><a href="http://erlangen-crm.org/current/P7i_witnessed:http://erlangen-crm.org/current/P14_carried_out_by" target="_blank">Excavators</a></td>
          <td class="gap"></td>
          <td class="record_value" data-rdf-predicate="http://erlangen-crm.org/current/P7i_witnessed:http://erlangen-crm.org/current/P14_carried_out_by" data-rdf-object="http://linkedarc.net/data/la_pp/actorhh|_|_|_|_|" data-rdf-objecttype="http://purl.org/crmeh#EHE0077_ProjectTeamMember" data-rdf-options="edit">
          	
          	<div itemscope itemtype ="http://schema.org/Person">
          		<span itemprop="name">http://linkedarc.net/data/la_pp/actorhh</span>
          	</div>
</td>
      </tr>
</div>

http://linkedarc.net/ws/query?project= request=search&project=[PROJECT_ID]&datatable=[DATATABLE_ID]& record_index=[ RECORD_INDEX]&searchby_param1=[SEARCH_PARAM1]&searchby_comparison1=[SEARCH_COMPARISON1]&searchby_value1=[SEARCH_VALUE1]&searchby_valuetype1=[SEARCH_VALUETYPE1]&searchby_constraint1=[SEARCH_CONSTRAINT1]

DescriptionSearch the datatable based on a list of search criteria.
Parameters
namedescriptiontype
projectProject ID stringstring
datatableDatatable ID stringstring
record_indexThe index of the record in the findsetinteger
searchby_param1The predicate URI to be used in the first criterion of the searchstring
searchby_comparison1The comparison operator for the first search criterion(equals)
searchby_value1The value to be used in the first criterion of the searchstring
searchby_valuetype1The type of the value to be used in the first criterion of the search(xsd:string, xsd:float, xsd:anyURI, xsd:date)
searchby_constraint1An additional constraint to be applied to the first criterion of the search. Normally this should be set to 'undefined'.string
Note that you can include as many search criteria as you wish by adding additional parameters in the form searchby_xxxn where n is an integer 1 greater than that used in the previous set of search criteria.

Sample return

{
    "pSearchRet": {
        "nSetCount": 102,
        "szCurrentRecordName": "47"
    }
}