Skip to main content
Version: 24.12

Upload a Graph (Asset)

POST /graph

Upload a Graph (Asset):

Parameters

nameintyperequireddescription
assetquerystringtrueThe Asset Id of the Graph
assetNamequerystringfalseThe Asset Name of the Graph
assetDescriptionquerystringfalseThe Asset Description of the Graph
assetVersionquerystringfalseThe Asset Version of the Graph
contractquerystringfalseThe contract under which the graph should be published
isFederatedquerybooleanfalseWhether the graph should be visible in the Federated Catalogue
ontologyquerystringfalseMultiple references to ontologies which are referenced in the graph
allowServicePatternquerystringfalseA regex indicating which external SERVICE Iris are allowed when traversing this graph.
denyServicePatternquerystringfalseA regex indicating which external SERVICE Iris are forbidden when traversing this graph.
shapequerystringfalseThe shape of the asset if it is known.

Request Body

Headers
content-typetext/turtle
Example graph in ttl syntax
#################################################################
# Graph Asset in TTL/RDF/OWL FORMAT
# See copyright notice in the top folder
# See authors file in the top folder
# See license file in the top folder
#################################################################

@prefix : <GraphAsset?consumer=Upload> .
@prefix cx-core: <https://w3id.org/catenax/ontology/core#> .
@prefix cx-common: <https://w3id.org/catenax/ontology/common#> .
@prefix cx-supply: <https://w3id.org/catenax/ontology/supply-chain#> .
@prefix cx-mat: <https://w3id.org/catenax/taxonomy/material#> .
@prefix bpnl: <urn:bpn:legal:> .
@prefix bpns: <urn:bpn:site:> .
@prefix bpna: <urn:bpn:address:> .
@prefix bpnl: <urn:bpn:legal:> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

:Chain1 rdf:type cx-supply:SupplyRelationship;
cx-supply:material cx-mat:Rubber;
cx-supply:consumer bpna:BPNL00000003COJN;
cx-supply:supplier bpns:BPNL00000003CPIY.
Headers
content-typetext/csv
Example graph in csv syntax
IRI,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,https://w3id.org/catenax/ontology/supply-chain#material,https://w3id.org/catenax/ontology/supply-chain#consumer,https://w3id.org/catenax/ontology/supply-chain#supplier
:Chain1,<https://w3id.org/catenax/ontology/supply-chain#SupplyRelationship>,<https://w3id.org/catenax/taxonomy/material#Rubber>,<urn:bpn:address:BPNL00000003COJN>,<urn:bpn:site:BPNL00000003CPIY>

Code Snippets

Shell + Curl
curl --request POST \
--url 'https://knowledge.dev.demo.catena-x.net/consumer-matchmaking/api/graph?asset=GraphAsset%3Fprovider%3DTraceability&assetName=Sample%20Graph&assetVersion=3.0.2&assetDescription=Uploads%20some%20sample%20data.&contract=Contract%3Fprovider%3DGraph&isFederated=true&deniedServicePattern=https%3F%3A%2F%2F.*' \
--header 'content-type: text/csv' \
--data ' IRI,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,https://w3id.org/catenax/ontology/supply-chain#material,https://w3id.org/catenax/ontology/supply-chain#consumer,https://w3id.org/catenax/ontology/supply-chain#supplier
:Chain1,<https://w3id.org/catenax/ontology/supply-chain#SupplyRelationship>,<https://w3id.org/catenax/taxonomy/material#Rubber>,<urn:bpn:address:BPNL00000003COJN>,<urn:bpn:site:BPNL00000003CPIY>
'

Responses

200

Graph has been uploaded and published.

204

Graph has been uploaded and description updated.

400

Bad request or malformed TTL/CSV

500

Fatal error

(C) 2021,2024 Contributors to the Eclipse Foundation. SPDX-License-Identifier: CC-BY-4.0