# actinia-metadata-plugin API Reference

Contains communication with a metadata catalog via OGC-CSW, in usage with GeoNetwork opensource.

##### Request Content-Types: application/json

##### Schemes: https, http

##### Version: 0.0

# File Management

File Management

## Upload file.

POST /files

File can be uploaded, best used with https://bmvimetadaten.mundialis.de.

200 OK
SimpleStatusCodeResponseModel

Success or failure of connection

##### Response Example (200 OK)

    {
      "status": 200,
      "message": "success"
    }

# GeoNetwork

GeoNetwork

## Get geodata object from requests to Geonetwork opensource by one or many tags.

GET /metadata/geodata/tags/{tags}

The request will ask Geonetwork which metadata records are available for a certain tag or more tags separated by comma and returns a parsed record build from model. At the moment only the first record is returned.

tags: string
in path

One or more Geonetwork tags, comma separated

200 OK
GeodataResponseModel

Modelled Search Results from Geonetwork

##### Response Example (200 OK)

    {
      "uuid": "da165110-88fd-11da-a88f-000d939bc5d8",
      "bbox": [
        51.1,
        -34.6,
        -17.3,
        38.2
      ],
      "crs": "urn:ogc:def:crs:::WGS 1984",
      "table": "http://www.fao.org/ag/AGL/aglw/aquastat/watresafrica/index.stm"
    }

GeoNetwork

## Get geodata object from requests to Geonetwork opensource by uuid.

GET /metadata/geodata/uuids/{uuid}

The request will ask Geonetwork which metadata records are available for a certain uuid and returns a parsed record build from model. At the moment only the first record is returned.

uuid: string
in path

A Geonetwork uuid from a record

200 OK
GeodataResponseModel

Modelled Search Results from Geonetwork

##### Response Example (200 OK)

    {
      "uuid": "da165110-88fd-11da-a88f-000d939bc5d8",
      "bbox": [
        51.1,
        -34.6,
        -17.3,
        38.2
      ],
      "crs": "urn:ogc:def:crs:::WGS 1984",
      "table": "http://www.fao.org/ag/AGL/aglw/aquastat/watresafrica/index.stm"
    }

GeoNetwork

## Requests a category from Geonetwork opensource.

GET /metadata/raw/categories/{category}

The request will ask Geonetwork which metadata records are available for a certain category and returns the JSON response with these records. Requirement: a virtual CSW is defined in Geonetwork

category: string
in path

A Geonetwork category

200 OK

The Search Results from Geonetwork

##### Response Example (200 OK)

    {
      "csw:GetRecordsResponse": {
        "@xmlns:csw": "http://www.opengis.net/cat/csw/2.0.2",
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "@xsi:schemaLocation": "http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",
        "csw:SearchStatus": {
          "@timestamp": "2018-03-28T13:46:43"
        },
        "csw:SearchResults": {
          "@numberOfRecordsMatched": "2",
          "@numberOfRecordsReturned": "2",
          "@elementSet": "full",
          "@nextRecord": "0",
          "csw:Record": [
            {
              "@xmlns:ows": "http://www.opengis.net/ows",
              "@xmlns:dc": "http://purl.org/dc/elements/1.1/",
              "@xmlns:geonet": "http://www.fao.org/geonetwork",
              "@xmlns:dct": "http://purl.org/dc/terms/",
              "dc:identifier": "d619aac5-6fc7-44f2-9552-7f8bb4d826e0",
              "dc:date": "2018-02-02T09:47:25",
              "dc:title": "Localities in Victoria (VMADMIN.LOCALITY_POLYGON) - Comprehensive Elements",
              "dc:type": "dataset",
              "dc:subject": [
                "BOUNDARIES-Administrative",
                "LAND-Ownership",
                "boundaries"
              ],
              "dc:format": [
                "Most popular formats including ESRI shape, MapInfo Tab and Oracle Spatial",
                "Most popular formats including ESRI shape, MapInfo Tab and Oracle Spatial"
              ],
              "dct:abstract": "This dataset is the definitive set of locality boundaries for the state of Victoria            as defined by Local Government and registered by the Registrar of Geographic Names.            The boundaries are aligned to Vicmap Property. This dataset is part of the Vicmap Admin dataset series.",
              "dc:description": "This dataset is the definitive set of locality boundaries for the state of Victoria            as defined by Local Government and registered by the Registrar of Geographic Names.            The boundaries are aligned to Vicmap Property. This dataset is part of the Vicmap Admin dataset series.",
              "dc:rights": [
                "intellectualPropertyRights",
                "otherRestrictions"
              ],
              "dc:language": "eng",
              "dc:source": "Local Government defines suburb, town and rural district boundaries after seeking appropriate consultation with all interested parties.              Proposed boundaries/names are submitted to the Registrar of Geographic Names for approval and formal gazettal.              As boundary and name information changes are processed through the formal definition and gazettal process at the Registrar of Geographic Names, the amendments will be flagged              and the dataset will be updated by the maintainer with all new boundaries aligned to Vicmap Property.",
              "ows:BoundingBox": {
                "@crs": "urn:ogc:def:crs:::4283",
                "ows:LowerCorner": "150 -39",
                "ows:UpperCorner": "141 -34"
              },
              "dc:URI": {
                "@description": "Web page listing Data Service Providers (DSP)s",
                "#text": "http://www.land.vic.gov.au/vicmapdsp"
              }
            },
            {
              "@xmlns:ows": "http://www.opengis.net/ows",
              "@xmlns:dc": "http://purl.org/dc/elements/1.1/",
              "@xmlns:geonet": "http://www.fao.org/geonetwork",
              "@xmlns:dct": "http://purl.org/dc/terms/",
              "dc:identifier": "78f93047-74f8-4419-ac3d-fc62e4b0477b",
              "dc:date": "2018-02-02T09:47:45",
              "dc:title": "Physiographic Map of North and Central Eurasia (Sample record, please remove!)",
              "dc:subject": [
                "physiography, soil",
                "Eurasia",
                "geoscientificInformation"
              ],
              "dct:abstract": "Physiographic maps for the CIS and Baltic States (CIS_BS), Mongolia, China and Taiwan Province of China. Between the three regions (China, Mongolia, and CIS_BS countries) DCW boundaries were introduced. There are no DCW boundaries between Russian Federation and the rest of the new countries of the CIS_BS. The original physiographic map of China includes the Chinese border between India and China, which extends beyond the Indian border line, and the South China Sea islands (no physiographic information is present for islands in the South China Sea). The use of these country boundaries does not imply the expression of any opinion whatsoever on the part of FAO concerning the legal or constitutional states of any country, territory, or sea area, or concerning delimitation of frontiers. The Maps visualize the items LANDF, HYPSO, SLOPE that correspond to Landform, Hypsometry and Slope.",
              "dc:description": "Physiographic maps for the CIS and Baltic States (CIS_BS), Mongolia, China and Taiwan Province of China. Between the three regions (China, Mongolia, and CIS_BS countries) DCW boundaries were introduced. There are no DCW boundaries between Russian Federation and the rest of the new countries of the CIS_BS. The original physiographic map of China includes the Chinese border between India and China, which extends beyond the Indian border line, and the South China Sea islands (no physiographic information is present for islands in the South China Sea). The use of these country boundaries does not imply the expression of any opinion whatsoever on the part of FAO concerning the legal or constitutional states of any country, territory, or sea area, or concerning delimitation of frontiers. The Maps visualize the items LANDF, HYPSO, SLOPE that correspond to Landform, Hypsometry and Slope.",
              "dc:rights": [
                "copyright",
                "copyright"
              ],
              "dc:language": null,
              "dc:source": null,
              "ows:BoundingBox": {
                "@crs": "urn:ogc:def:crs:::Lambert Azimuthal Projection",
                "ows:LowerCorner": "156 -3",
                "ows:UpperCorner": "37 83"
              },
              "dc:URI": [
                {
                  "@protocol": "WWW:DOWNLOAD-1.0-http--download",
                  "@name": "phy.zip",
                  "@description": "Physiography of North and Central Eurasia Landform (Gif Format)",
                  "#text": "http://localhost:8080/geonetwork/srv/api/records/78f93047-74f8-4419-ac3d-fc62e4b0477b/attachments/phy.zip"
                },
                {
                  "@protocol": "OGC:WMS",
                  "@name": "GEONETWORK:phy_landf_7386",
                  "@description": "Physiography of North and Central Eurasia Landform",
                  "#text": "http://data.fao.org/maps/wms"
                },
                {
                  "@protocol": "OGC:WMS",
                  "@name": "GEONETWORK:phy_slope_7386",
                  "@description": "Physiography of North and Central Eurasia Slope",
                  "#text": "http://data.fao.org/maps/wms"
                },
                {
                  "@protocol": "OGC:WMS",
                  "@name": "GEONETWORK:phy_hypso_7386",
                  "@description": "Physiography of North and Central Eurasia Hypsography",
                  "#text": "http://data.fao.org/maps/wms"
                },
                {
                  "@protocol": "image/gif",
                  "@name": "Physiographic Map (small preview)",
                  "#text": "http://localhost:8080/geonetwork/srv/api/records/78f93047-74f8-4419-ac3d-fc62e4b0477b/attachments/phy_s.gif"
                },
                {
                  "@protocol": "image/gif",
                  "@name": "Physiographic Map",
                  "#text": "http://localhost:8080/geonetwork/srv/api/records/78f93047-74f8-4419-ac3d-fc62e4b0477b/attachments/phy.gif"
                }
              ]
            }
          ]
        }
      }
    }

GeoNetwork

## Requests one or many tags from Geonetwork opensource.

GET /metadata/raw/tags/{tags}

The request will ask Geonetwork which metadata records are available for a certain tag or more tags separated by comma and returns the JSON response with these records.

tags: string
in path

One or more Geonetwork tags, comma separated

200 OK

The Search Results from Geonetwork

##### Response Example (200 OK)

    {
      "csw:GetRecordsResponse": {
        "@xmlns:csw": "http://www.opengis.net/cat/csw/2.0.2",
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "@xsi:schemaLocation": "http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",
        "csw:SearchStatus": {
          "@timestamp": "2018-03-28T13:42:41"
        },
        "csw:SearchResults": {
          "@numberOfRecordsMatched": "2",
          "@numberOfRecordsReturned": "2",
          "@elementSet": "full",
          "@nextRecord": "0",
          "csw:Record": [
            {
              "@xmlns:ows": "http://www.opengis.net/ows",
              "@xmlns:dc": "http://purl.org/dc/elements/1.1/",
              "@xmlns:geonet": "http://www.fao.org/geonetwork",
              "@xmlns:dct": "http://purl.org/dc/terms/",
              "dc:identifier": "da165110-88fd-11da-a88f-000d939bc5d8",
              "dc:date": "2018-02-02T09:46:51",
              "dc:title": "Hydrological Basins in Africa (Sample record, please remove!)",
              "dc:subject": [
                "watersheds",
                "river basins",
                "water resources",
                "hydrology",
                "AQUASTAT",
                "AWRD",
                "Africa",
                "inlandWaters"
              ],
              "dc:format": [
                "ShapeFile",
                "ShapeFile"
              ],
              "dct:abstract": "Major hydrological basins and their sub-basins. This dataset divides the African continent according to its hydrological characteristics.\nThe dataset consists of the following information:- numerical code and name of the major basin (MAJ_BAS and MAJ_NAME); - area of the major basin in square km (MAJ_AREA); - numerical code and name of the sub-basin (SUB_BAS and SUB_NAME); - area of the sub-basin in square km (SUB_AREA); - numerical code of the sub-basin towards which the sub-basin flows (TO_SUBBAS) (the codes -888 and -999 have been assigned respectively to internal sub-basins and to sub-basins draining into the sea)",
              "dc:description": "Major hydrological basins and their sub-basins. This dataset divides the African continent according to its hydrological characteristics.\nThe dataset consists of the following information:- numerical code and name of the major basin (MAJ_BAS and MAJ_NAME); - area of the major basin in square km (MAJ_AREA); - numerical code and name of the sub-basin (SUB_BAS and SUB_NAME); - area of the sub-basin in square km (SUB_AREA); - numerical code of the sub-basin towards which the sub-basin flows (TO_SUBBAS) (the codes -888 and -999 have been assigned respectively to internal sub-basins and to sub-basins draining into the sea)",
              "dc:language": "eng",
              "dc:source": "The linework of the map is obtained by delineating drainage basin boundaries from an hydrologically corrected digital elevation model with a resolution of 1 * 1 km.",
              "ows:BoundingBox": {
                "@crs": "urn:ogc:def:crs:::WGS 1984",
                "ows:LowerCorner": "51.1 -34.6",
                "ows:UpperCorner": "-17.3 38.2"
              },
              "dc:URI": [
                {
                  "@protocol": "WWW:LINK-1.0-http--link",
                  "@name": "",
                  "@description": "Online link to the  'Water Resources and Irrigation in Africa'- website",
                  "#text": "http://www.fao.org/ag/AGL/aglw/aquastat/watresafrica/index.stm"
                },
                {
                  "@protocol": "WWW:DOWNLOAD-1.0-http--download",
                  "@name": "basins.zip",
                  "@description": "Hydrological basins in Africa (Shapefile Format)",
                  "#text": "http://localhost:8080/geonetwork/srv/api/records/da165110-88fd-11da-a88f-000d939bc5d8/attachments/basins.zip"
                },
                {
                  "@protocol": "OGC:WMS",
                  "@name": "GEONETWORK:basins_296",
                  "@description": "Hydrological basins in Africa",
                  "#text": "http://data.fao.org/maps/wms"
                },
                {
                  "@protocol": "image/gif",
                  "@name": "Hydrological Basins in Africa (small preview)",
                  "#text": "http://localhost:8080/geonetwork/srv/api/records/da165110-88fd-11da-a88f-000d939bc5d8/attachments/thumbnail_s.gif"
                },
                {
                  "@protocol": "image/gif",
                  "@name": "Hydrological Basins in Africa",
                  "#text": "http://localhost:8080/geonetwork/srv/api/records/da165110-88fd-11da-a88f-000d939bc5d8/attachments/thumbnail.gif"
                }
              ]
            },
            {
              "@xmlns:ows": "http://www.opengis.net/ows",
              "@xmlns:dc": "http://purl.org/dc/elements/1.1/",
              "@xmlns:geonet": "http://www.fao.org/geonetwork",
              "@xmlns:dct": "http://purl.org/dc/terms/",
              "dc:identifier": "d619aac5-6fc7-44f2-9552-7f8bb4d826e0",
              "dc:date": "2018-02-02T09:47:25",
              "dc:title": "Localities in Victoria (VMADMIN.LOCALITY_POLYGON) - Comprehensive Elements",
              "dc:type": "dataset",
              "dc:subject": [
                "BOUNDARIES-Administrative",
                "LAND-Ownership",
                "boundaries"
              ],
              "dc:format": [
                "Most popular formats including ESRI shape, MapInfo Tab and Oracle Spatial",
                "Most popular formats including ESRI shape, MapInfo Tab and Oracle Spatial"
              ],
              "dct:abstract": "This dataset is the definitive set of locality boundaries for the state of Victoria            as defined by Local Government and registered by the Registrar of Geographic Names.            The boundaries are aligned to Vicmap Property. This dataset is part of the Vicmap Admin dataset series.",
              "dc:description": "This dataset is the definitive set of locality boundaries for the state of Victoria            as defined by Local Government and registered by the Registrar of Geographic Names.            The boundaries are aligned to Vicmap Property. This dataset is part of the Vicmap Admin dataset series.",
              "dc:rights": [
                "intellectualPropertyRights",
                "otherRestrictions"
              ],
              "dc:language": "eng",
              "dc:source": "Local Government defines suburb, town and rural district boundaries after seeking appropriate consultation with all interested parties.              Proposed boundaries/names are submitted to the Registrar of Geographic Names for approval and formal gazettal.              As boundary and name information changes are processed through the formal definition and gazettal process at the Registrar of Geographic Names, the amendments will be flagged              and the dataset will be updated by the maintainer with all new boundaries aligned to Vicmap Property.",
              "ows:BoundingBox": {
                "@crs": "urn:ogc:def:crs:::4283",
                "ows:LowerCorner": "150 -39",
                "ows:UpperCorner": "141 -34"
              },
              "dc:URI": {
                "@description": "Web page listing Data Service Providers (DSP)s",
                "#text": "http://www.land.vic.gov.au/vicmapdsp"
              }
            }
          ]
        }
      }
    }

GeoNetwork

## Requests an uuid from Geonetwork opensource.

GET /metadata/raw/uuids/{uuid}

The request will ask Geonetwork which metadata records are available for a certain uuid and returns the JSON response with this record.

uuid: string
in path

A Geonetwork uuid from a record

200 OK

The Search Results from Geonetwork

##### Response Example (200 OK)

    {
      "csw:GetRecordByIdResponse": {
        "@xmlns:csw": "http://www.opengis.net/cat/csw/2.0.2",
        "csw:Record": {
          "@xmlns:ows": "http://www.opengis.net/ows",
          "@xmlns:dc": "http://purl.org/dc/elements/1.1/",
          "@xmlns:geonet": "http://www.fao.org/geonetwork",
          "@xmlns:dct": "http://purl.org/dc/terms/",
          "dc:identifier": "da165110-88fd-11da-a88f-000d939bc5d8",
          "dc:date": "2018-02-02T09:46:51",
          "dc:title": "Hydrological Basins in Africa (Sample record, please remove!)",
          "dc:subject": [
            "watersheds",
            "river basins",
            "water resources",
            "hydrology",
            "AQUASTAT",
            "AWRD",
            "Africa",
            "inlandWaters"
          ],
          "dc:format": [
            "ShapeFile",
            "ShapeFile"
          ],
          "dct:abstract": "Major hydrological basins and their sub-basins. This dataset divides the African continent according to its hydrological characteristics.\nThe dataset consists of the following information:- numerical code and name of the major basin (MAJ_BAS and MAJ_NAME); - area of the major basin in square km (MAJ_AREA); - numerical code and name of the sub-basin (SUB_BAS and SUB_NAME); - area of the sub-basin in square km (SUB_AREA); - numerical code of the sub-basin towards which the sub-basin flows (TO_SUBBAS) (the codes -888 and -999 have been assigned respectively to internal sub-basins and to sub-basins draining into the sea)",
          "dc:description": "Major hydrological basins and their sub-basins. This dataset divides the African continent according to its hydrological characteristics.\nThe dataset consists of the following information:- numerical code and name of the major basin (MAJ_BAS and MAJ_NAME); - area of the major basin in square km (MAJ_AREA); - numerical code and name of the sub-basin (SUB_BAS and SUB_NAME); - area of the sub-basin in square km (SUB_AREA); - numerical code of the sub-basin towards which the sub-basin flows (TO_SUBBAS) (the codes -888 and -999 have been assigned respectively to internal sub-basins and to sub-basins draining into the sea)",
          "dc:language": "eng",
          "dc:source": "The linework of the map is obtained by delineating drainage basin boundaries from an hydrologically corrected digital elevation model with a resolution of 1 * 1 km.",
          "ows:BoundingBox": {
            "@crs": "urn:ogc:def:crs:::WGS 1984",
            "ows:LowerCorner": "51.1 -34.6",
            "ows:UpperCorner": "-17.3 38.2"
          },
          "dc:URI": [
            {
              "@protocol": "WWW:LINK-1.0-http--link",
              "@name": "",
              "@description": "Online link to the  'Water Resources and Irrigation in Africa'- website",
              "#text": "http://www.fao.org/ag/AGL/aglw/aquastat/watresafrica/index.stm"
            },
            {
              "@protocol": "WWW:DOWNLOAD-1.0-http--download",
              "@name": "basins.zip",
              "@description": "Hydrological basins in Africa (Shapefile Format)",
              "#text": "http://localhost:8080/geonetwork/srv/api/records/da165110-88fd-11da-a88f-000d939bc5d8/attachments/basins.zip"
            },
            {
              "@protocol": "OGC:WMS",
              "@name": "GEONETWORK:basins_296",
              "@description": "Hydrological basins in Africa",
              "#text": "http://data.fao.org/maps/wms"
            },
            {
              "@protocol": "image/gif",
              "@name": "Hydrological Basins in Africa (small preview)",
              "#text": "http://localhost:8080/geonetwork/srv/api/records/da165110-88fd-11da-a88f-000d939bc5d8/attachments/thumbnail_s.gif"
            },
            {
              "@protocol": "image/gif",
              "@name": "Hydrological Basins in Africa",
              "#text": "http://localhost:8080/geonetwork/srv/api/records/da165110-88fd-11da-a88f-000d939bc5d8/attachments/thumbnail.gif"
            }
          ]
        }
      }
    }

GeoNetwork

## Tests for active connection to Geonetwork opensource.

POST /metadata/test/connection

The request will ask the backend if it can successfully connect to Geonetwork.

200 OK
SimpleStatusCodeResponseModel

Success or failure of connection

##### Response Example (200 OK)

    {
      "status": 200,
      "message": "success"
    }

GeoNetwork

## Tests for active connection to Geonetwork opensource.

GET /metadata/test/connection

The request will ask the backend if it can successfully connect to Geonetwork.

200 OK
SimpleStatusCodeResponseModel

Success or failure of connection

##### Response Example (200 OK)

    {
      "status": 200,
      "message": "success"
    }

# Schema Definitions

## SimpleStatusCodeResponseModel: object

Simple response schema to inform about status.

status: number

  The status code of the request.

message: string

  A short message to describes the status

##### Example

    {
      "status": 200,
      "message": "success"
    }

## GeodataResponseModel: object

Model for object for geodata

uuid: string

  The Geonetwork uuid.

bbox: number[]

  The bounding box of the result.

number
crs: string

  The coordinate reference system of the result.

table: string

  The database connection string of the source of the result.

##### Example

    {
      "uuid": "da165110-88fd-11da-a88f-000d939bc5d8",
      "bbox": [
        51.1,
        -34.6,
        -17.3,
        38.2
      ],
      "crs": "urn:ogc:def:crs:::WGS 1984",
      "table": "http://www.fao.org/ag/AGL/aglw/aquastat/watresafrica/index.stm"
    }

Documentation by Spectacle