EasyGraph provides 'Knowledge Graph as a Service' capabilities, reducing the complexity and effort of incorporating a knowledge graph into an existing or new tech stack and thus allowing businesses to focus on adding business value rather than spending time building foundational components.
Once configured through EasyGraph Bootstrap, a simple seven step process, EasyGraph publishes a dynamic API providing GraphQL and HTTP endpoints to interact with the graph. EasyGraph Playground allows you to easily try out your configured API in a zero development environment.
The quickest way to get started with EasyGraph is to try it online. You can either sign up or sign in with LinkedIn account.
Go to https://easygraph.graphifi.com
To sign up click on the
button and fill the sign up form. Once you have signed up you can can login using your username and password.If you want to use your LinkedIn account, you must accept the Terms and Conditions. This will enable the
button. Click on it to complete the login process.Once logged in you will see options as below.
We would love to hear your feedback. While trying the application if you find any bug, have any suggestion or feature request you can easily provide your feedback as explained in the steps below.
Select Create Sandbox option and enter username and password for the root user of your sandbox. Click the
button to create sandbox. Once your sandbox is ready your screen will look as below.To login to your sandbox click the sandbox link. You should see sandbox login page as below.
Enter your sandbox root account username, password and click
button. Once logged in you should see dialog box to create a dataset as below.Enter name and description and click
button. You should see applications screen as shown below. Your sandbox setup is now complete. In the next section we will go through the example model and than we will bootstrap with example model.In all of our examples below we are going to use an ontology. In our ontology we will model entities for organisations, employees and images and the relationships between them.
You can download the ontology for the above model from https://easygraph.graphifi.com/docs/example-ontology.ttl.
To continue with quickstart follow the Quick Start steps in the Bootstrap section.
Click on the Bootstrap application in the dashboard.
There are only seven steps to the bootstrap process. It should only take a few minutes to go through a basic set up and if you are eager to do it as quickly as possible simply follow the instructions in the 'Quick start' boxes..
Use an example base IRI such as http://example.com/ for both fields. Enter 'YES' for 'Enable Data Reset'. For the language option you can leave it at its default for now.
Click the 'Next' button to move to the next step.
The first step of the bootstrap is to enter some basic information that EasyGraph needs.
The base IRIs must be of the form http:// or https:// to be valid. The base IRI for data will be used for all resources created using the generated APIs. The base IRI for schema will be used for any shapes and configuration generated by EasyGraph.
The default language currently only applies to searches made through the APIs.
Data reset allows you to wipe the data with a call to the /reset/data API endpoint. This is useful if you are building an application and want to do integration tests with EasyGraph where, for each test run, you want to reset the data.
You can download an example ontology file from https://easygraph.graphifi.com/docs/example-ontology.ttl (or if you want to go even faster you can select 'Example Ontology of Organisation Person and Image' to load an example ontology).
Browse for the ontology file from your file system if you are loading the example ontology. Once the file is selected your screen will look as shown below.
If you have selected 'Example Ontology of Organisation Person and Image' your screen will look as below.
Click the 'Next' button to move to the next step.
EasyGraph uses an ontology as its input to define the APIs that it generates. The ontology must be an OWL ontology as defined by the W3C OWL standard. Only a subset of OWL is supported. This subset consists of:
You can select ontologies using the Browse Files button or you can drag and drop files into the window. Files should be .ttl, .xml, .owl, .rdf, .rdfs, .nt or .jsonld and there is a limit of five files.
EasyGraph will do some checks to ensure the validity of the files you are uploading but we recommend that you put them through an ontology checker first.
If you want to set up API for SKOS/SKOS-XL based taxonomy you can choose predefined ontologies. If you developed your taxonomy using Graphologi then you can select Graphologi Model to setup your taxonomy API.
To bootstrap with a schema built using Schema Builder see Bootstrap With Schema
If you have used the example file or test ontology you do not need to do anything.
Click the 'Next' button to move to the next step.
Aliases are short names for properties and a feature of JSON-LD. EasyGraph attempts to automatically generate aliases based on the IRIs of classes and properties in the ontologies.
However, there is always the possibility of conflicts. In that situation EasyGraph will prepend prefixes for property names. Each conflicting Base IRI (namespace) can be given a prefix.
EasyGraph will use prefixes defined in any loaded ontologies as a starting point. If prefixes are not defined in an ontology file then you will need to define them in this step. Every prefix must be unique. There are some reserved prefixes which cannot be altered and these are shown with a icon in the prefix field. For example, in the screenshot below you can see that prefix 'ex' can be edited but 'eg', which is a system defined prefix, can not be changed.
If you have used the example ontology file or a test ontology you do not need to do anything as EasyGraph will have generated valid aliases.
Click the 'Next' button to move to the next step.
As explained in the previous section, aliases are part of the JSON-LD specification and allow IRIs to be substituted with more friendly short names, which makes for more readable JSON.
If you have used the example file the screen will look as below if you select 'From Ontology'.
Easygraph creates a JSON-LD context file and GraphQL schema automatically based on the ontology and prefixes as explained in the previous step.
Below are the steps which EasyGraph follows to resolve conflict in aliases
You do not need to do anything at this step.
Click the 'Next' button to move to the next step.
EasyGraph generates a ‘shape’ for each entity in the ontology. These shapes use the W3 SHACL standard.
The screen should look similar to the image below if you click on Organisation.
You can click on a shape name in list on the left to view the generated SHACL shape. By default a 'pretty' view of the shape is displayed but you have the option to click on 'View JSON-LD' to view the shape as JSON-LD.
Also, by default, only the properties associated 'directly' with the class are displayed. Directly means properties whose domain is defined in the ontology as the selected class. If you want to also view properties that are inherited from classes that are above in the hierarchy tree select 'Include Properties From Class Hierarchy'.
You do not need to do anything at this step.
Click the 'Next' button to move to the next step.
The screen should look similar to the image below.
ID setup controls which CRUD (create, read, update and delete) operations can be performed. By default all the lowest classes in the hierarchy are selected (those that have no subclass). You do not need to change anything on this screen.
To view superclasses or subclasses you can click on an item from the list on the left. Alternatively you can view the class hierarchy by clicking Tree view button. In this view, classes will show as a tree on the left hand side similarly to the screenshot below.
Note that in the class hierarchy if a class is selected for ID generation then all of its subclasses will be deselected.
For a read only API click on the icon and select 'Clear All (Read Only API)' option from the menu.
You do not need to do anything at this step.
Click the Playground.
button. This will complete the bootstrap process and from there you can return to the dashboard. Congratulations, at this point you are ready to explore your HTTP API and your GraphQL API. To continue the Quick Start, follow the Quick Start steps for the EasyGraphInverses in an ontology allow you to model the idea that if an entity A is related to another entity B by a property X then there is a property Y that applies in the opposite direction from entity B to entity A. For example if A hasParent B then hasParent might have an inverse hasChild, giving B hasChild A.
The screen should look similar to the image below.
By default all inverse properties are materialised. That is, if one direction is created the other is automatically generated. For example, in our model the member property is the inverse of the memberOf property, so if we create a resource of type Organisation and link it to a Person using the member property, the memberOf property will be generated for the Person resource, linking it back to the Organisation resource. In this screen you can disable this behaviour.
You’re all done. Click
button and you should see a 'Bootstrap Successful' screen as followsYou might want to add/update model after the bootstrap and regenerate the APIs to include changes from updated model. So after bootstrap if you try to bootstrap again you have three options.
First option is to "Reload complete model and merge manual changes" from the existing configuration. This option is useful if you have made many changes in the different ontology files and previously you made some configuration changes using System Manager. With this option you can reload new ontology and model will be updated based on the changes in the ontology. If you want to adjust Id generation you can do so from System Manager after the merge.
Second option is to "Load partial model , keep existing model and merge into existing configuration". This option is useful if you are extending the model. The difference between this option and previous option is that with this option shapes are not deleted.
Third option is to "Wipe existing configuration and bootstrap again". With this option all the existing configuration are cleared and bootstrap is done based on the model selected.
If you use Apache Jena Fuseki or RDF4J as backend, EasyGraph can be configured to support multiple datasets. When multiple datasets configuration is on, data for each dataset is stored in a separate database. To access data from a dataset add dataset name in the API endpoint. For example if you have created dataset named TestDataset then the graph search endpoint for TestDataset will be {base-url}/TestDataset/graph/search. If you are using EasyGraph UI you can select dataset as shown below.
If a dataset is selected then applications like Bootstrap, System Manager and Playground work with the selected dataset. Selected dataset is also shown in the middle of the top bar.
Downloadable version of EasyGraph has multiple datasets enabled by default, this can be disabled by setting EG_MULTIPLE_DATASETS=false in conf/setenv.sh
Please note that multiple datasets are only supported for Apache Jena Fuseki and RDF4J. Multiple datasets help in cost reduction during development but for production we recommend to disable multiple dataset as performance will be better.
A user with Super Admin permission can manage datasets by clicking menu option on left. If a logged in user does not see this option then it means user does not have Super Admin permission.
To add a dataset click
button and enter details in the dialog.To edit description of the dataset click edit icon button on the dataset card. Please note that dataset name can not be changed.
All the user details, passwords and some other data is stored in a separate database.
If multiple dataset configuration property is set to false then UI app works with default dataset and all the API requests execute against default dataset. For example if multiple dataset property is false and backend is RDF4J or Fuseki, a repository named egData is auto created to store all the data. For other databases like MarkLogic, database connection details are set through configurations. Please see setup section for more details.
EasyGraph users can be managed from the user management. By default only authenticated user can access EasyGraph UI or API.
To access user management screen click menu option on the left of the home screen and your screen should look as below.
To add a user click the add user icon button and enter the details in the dialog. To view user details click user name.
Any user can be given Super Admin permission on the user details screen. A user with Super Admin permissions can do everything a root user can do e.g. manage datasets, manage users and configure API.
Please note that If multiple datasets configuration is set to true only then dataset access for user can be configured from the Datasets block on user details screen. If multiple datasets is false then all users can access default dataset and Datasets block is not show on the user details screen.
EasyGraph supports JWT(JSON Web Token) based authentication and public/private key pair based authentication.
If authentication is enabled under authentication menu option in System Manager then a user can generate JWT access token by sending a POST request to {base-url}/egmManagement/login. Once user has token other API requests can be executed by specifying Authorization HTTP header e.g. Authorization: Bearer {JWT_TOKEN}
For system to system integration JWT token based authentication may not be the best approach as JWT tokens expire after certain time. For system to system integration use case, EasyGraph supports public/private key based authentication. A public key of the user can be stored in EasyGraph and then user can sign the API request with private key.
Public/private key pair can also be generated through the EasyGraph UI on user management screen. To generate the key pair click button.
In the dialog enter description and click
button. This should generate a key pair and you can download the private key.If you have generated RSA key pair using some other tool you can upload the public key by clicking .
Signing of the request is based on https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html. Below is the summary of the steps to sign a request.
timestamp+ "\n" +keyId+"\n"+requestPath+"\n"+queryString+"\n"+headerString+"\n"+requestBodySHA256
Authorization : Algorithm="SHA256withRSA";KeyId="https://easygraph.graphifi.com/data/publickey/17ceb312-8cfd-45ac-987d-bd5cc2f5812f";Timestamp="1621894484263;SignedHeaders="Content-Type,Prefer";Signature="KppfgLsod5QDkWjojm6eNpm6Q264ijBk8l/W7x+M3JiZGspPVpAlMXL+ZXikKIws3dh7ml56W41OvulEE6M10vo1f0kSTLGeFB9MTj9Q9WliSV9H0a8Y9Z0zWRGvVpIpl9Bb6UvDe0WK/GwQYtoQGOWkTvwPk+/S0jb+8AhHscLE/0OJOWGpYU0FPiIElJUi+yTH96kwwd4MOwQe28Tu1LXGIV2dJYMH+gd3x4ni2o0MUOu/QE5ERQH8RK/hyCvunURlZKuoybdO5cs2wLnD96zJ3Wgpi0UkGGULBNscN4xkd+AV+BS/wdIuod2WJ6raa9axtjSTviBfawlqNTY2jzPSdBUgrmSEZA21t6TdZsyWhxeBklz7kLOXnF3rgiwvW81NaI5JuCN/8oqLiR1JcciFOjp4Qgew/kikR3hEjrHFnfNMoPGM3//u6TqIz9pp0k1xYNPwtIIxcITCh9w/PnwSu0oeJz+d0KVIPx5qcYu8GVfuNE6QlIGPOQDTjpRTDm+gSRyTJ4uw+k1HW5mitcK+IUmd/X/Jchxn7KvHp5bJ8H7kB4TGFGZvfUH2dBKbsyQyY4rEE6KJ+h/pSOA1Z9EtdNf2xZBj4nio/FEoAgxkCEuHGlDNhpoxkCMVAEDKqd9WJzJ+yrUbrMHsRapl60yMU8t+2zE7CIUonHarLU4="
Code below is example of how you can implement it in Java. Please note you might want to adjust package statement in the code.
Private key in below code is for example only. Please do not use it anywhere in production code.
package com.graphifi; import org.apache.commons.codec.digest.DigestUtils; import java.io.IOException; import java.io.InputStream; import java.security.KeyFactory; import java.security.PrivateKey; import java.security.Signature; import java.security.spec.PKCS8EncodedKeySpec; import java.util.Arrays; import java.util.Base64; import java.util.stream.Collectors; import static java.nio.charset.StandardCharsets.UTF_8; public class RequestSigner { private static final String SHA_256_WITH_RSA = "SHA256withRSA"; private static final String RSA = "RSA"; private static final String PRIVATE_KEY = "-----BEGIN RSA PRIVATE KEY-----\nMIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDKKx50Gl0RiTi2RpyXSAM8FwJGugf1jFLLS8yp3x5F0HOCc28ahu/+y5NrQjAH/vqI8MzOy6L+U60Dv6pSjVwv3nTFvBIOj53e3bFLr5hCxd7WPv1aNSJT/jZbBUcF4FbOV+dakNmr7RNWBdGai/jZ8dYSJ+YGvtgnJK+CZrP0HDaxz6x045Dzimokbi61xQsg0X1zhSmABhHhcA52WTNTvgOwIJKjdDHpYTZYZJRy+zymn5le34cG7sdDYMGwZm6ZCpXSk2BAAa84VZnhAqodZY2+bgPOkLSMFAWbodsr7/6n5PSVwpGyrmR1tAF9PwxijAhnMmImkwzV0zc7RYUrTJk8zbO/ZBWUbjJdVTQcGlieaCF2xdn/2TMvgRGDOh1uFm/OmOZVyI2oiwSXNu8z7Nw4Rmlda14/ARdd09svE24LexVnTSeTD8YiJsnvIo996pIFENXKtCmbcxwyZY4hx2XkCp96m9RruZ5ZVKO/tYnnX2DeYxN9xQl7eNr98fgluqSCG/MG2X5zE1mCPfz3jPBjQaTzBJjfP3bLZ/9rGaCNJK8267wpdu2FV3TK4ZRqr/BEfL67m1IHr6gyEjubGjNIUhnICIK95LAeBXVNXdPRkkbBE+aavu+xqZQ3LGh9d1OlqQolg/Sl+l7vP4SrNOnve0vmIT3tstSz8JUUWwIDAQABAoICACPZM4Q47InggDrqGHhG37P3DINIF4M2B7Re04LHupF8ng7isy/L/6B5rsFVMjkowHop4NdGird4VPSWNvh+cntWgfRSHg2Q79iGDRszntcwSQxKjRhC1bx5FmBbdjWXiyz5r1+C0eZHmqclTv6NlWnoFSKRCpvlmWSPf8OqvHwryJMNFTKA68ITqDCfjQ7USt3d59XlJe+6o88K1LWtqYlO506C6B2ty+/rOfzAkQY2gJG3OTX2gvX6v0C2VoIWF8RxeRGm6mlPIyflHe0lUM73pAPBdFFbnXg9UKVBNSD8ZHaXBbvMjZNWkx+/9Iel92c+F3tdFsRqTNtZobCT6kHrcb5CHX/I75S86kkHH5UPlMRxS6eu8ovS8Wb5zKl0F8vV+S+rfKm1UrXlklq54OH5i+r9aXLWAJgYThOi8VFRVRSzdP5ESEWD4KN67vmSpr8KqOhbKKMrSlc8OfWAIWBvFJJ/Szk9DNioauzISJK0PLxuxjiaad1c/HyFG1KcgUMXzkj8qnYFD6eRMRKCkba/ImXPnTNMU1MksmbneZHkSxIYRh5B11eVogYM+zN3M3xg+qU1fOPpqsjq9vQstBUlom6MLvE6TLfjv6xrPDypgh8otyis+rfpULaLL08ajsAuLC2W4rlCCUaCMG/0yQdquyRbtWj2tKEqZ+ccZqV5AoIBAQDyg4oSnyhbOz/s42j5ve7ztSIKlnQ8AGm3Yp1LiecAwAynWDrhkm+OYTJtbCgIcmJBumSppTMhBn4yMImVEEB6NHscMULYu0T9PgfhcGr/klfCmSPtisahakXoQkLOVQoZCnTWyKksrSb/qpxQHMSPy1qn2WMFOkBiXQkI0w+7krSjlwq7UZhNSrFhnmO3pKruw93UVGYNSzhZFPGdv13NBsJPg+7w5nZySWv6WVaCKVAPP6en4xh0LtccLDx6PgyWOsIWQzUVnRW4Ab0JlTiE/Vt9DhQNwq1y3r8gEzMhKMuwykN1NoJ8ODFv+y9F60owOJTP2bCFY41ixMNJFIFVAoIBAQDVaTeMGQUgWY4k8KCSWDwa5qFDQpnMhuTw/kiEciX6M65dVg8yQ8UNP0T2ZnGZg3P4Je8p2lfQiNTx7JR4fOY2keC4jmlKIyxBJE2QZIqku690WR/JgKvqF65lLWNaAcPZsDCIXvI1Gtm5rMc8DgUFSSn4p6LUKBCU4ZeQyqyA5sLnklQLPGnSaoHQNIGNrPjd21hglOMFpw7EP0YcGY8eoHsJJywMPx8BWGRfZImIqGuTCAUXmpk/4f4oNJUA9BDB+EzP+RWkXVY3Tw4oEsAmmuyJcJle+Zbl+Dvfy45NKby5xh9/ObHF4STI+biAkljlFzyacd05vpQO67Z9pv7vAoIBAQDqn+J8Y6kaorcVC2rrfBtrgwm9LpSj3E5rEqhVhcSNEEDtwkmtJQxytoygGqych3WSW6+6BU7zG6IKErV5FvEaih21R9+BaaS0UUg0jpumSUJIzfpZfhLv5a5ep4SUtOeBFIG3rwklZRw+7CQwybRN3hMGIyZOz22s/I+aDwDAm43SW3YRhj6QQLxeUmvtJw4M1EiQfVsCb4zDeqTL1nH8wxZI8b7BKGbd6TTjT32Hjkqbhh1BK0/kT9Dju9SC+/cXfR97hGgeUgzKKjxmwgyddbUGxxEVwwwl/2TvtkOYSCzRDM643xTc80y5J040GhB7mLI4aUcDti36qZy53nHFAoIBAQDShqBIcWowNohWApa0p5xrgTZ2jp4AONZissbA+YZjY1ZQNxR4pogegFq8o+TO5vGhS3K6m+1jB4jiO1tf3P6RuKiyB7LwcvA2NuTZW4W16ny0TzNfabKuFLxyjSrkYLde6UOHU/qlzp4YX8yPftkPFNT1uhGULw3kgQMuz/EKnBqLrTuBdhCChZUX2qQvKgK7gaWWaWnnapzTlgPItqIMOY4GQoFed2pTvmoN/LT8fgDZI+E6HsWtUniSGwUe0qYxY4wK4hKqeXUSzMcPWyf5LX3IO67hFWD57j7KkBkKH/FQZpUtwbGQnoDWThrnovdUz+52AXuWel2+tmLpY7M7AoIBACcFEHpsbdSXffiJwANEtkEIT4KtGaFeprbVZ1f25zGGlVE2aX2kewZfZ+tx6WJ1ERM+JGllzlgtlbBMpXUdSY7TpvFPfomemfVbROWAgGB0U+CBF67xX1yK4CtDvzylsVYsw3l5fkQPhgBPGZhRAWW+1nEeg3jgX9SFhBz2m5AYp5ROHPhL0hsO1eRBpUZICH+qSlcm9Ks+sH5w0Wcws2r30acdc3ycZ7+AXIRRztcmUwqh1rOMylpI29EVUF7WpV+0biZI5yW2rGGzeTReBdJd4Owctoq21stffF2MFd4AtpkY0Dr7QIOA9SoQeTlhzAJFLAyaw6RiRRx++Wwhmus=\n-----END RSA PRIVATE KEY-----"; public static void main(String []args) throws IOException { //Key value pair can be generated from the EasyGraph UI PrivateKey privateKey = loadRSAPrivateKey(PRIVATE_KEY); //Obtain Key id value from EasyGraph UI String keyId = "https://easygraph.graphifi.com/data/publickey/17ceb312-8cfd-45ac-987d-bd5cc2f5812f"; //This is path of the request String path = "/graph"; String queryParams = getQueryString("z=zvalue&a=avalue"); String headers = "Content-Type:application/ld=json"+"\n"+"Prefer:return=representation;data=\"{description}\";dataFilter=paths"; //As Content-Type and Prefer header are used to compute signature specify these headers in the SignedHeaders String signedHeaders = "Content-Type,Prefer"; //If there is no body then set value to null String body = "Test body"; if(body == null) { body = ""; } String bodySHA256 = computeSHA256(body); long timeMillis = System.currentTimeMillis(); String signature = sign(timeMillis, keyId, path, queryParams, headers, bodySHA256, privateKey); String authorizationHeaderValue = "Algorithm=\"SHA256withRSA\";KeyId=\""+keyId+"\";Timestamp=\""+timeMillis+";SignedHeaders=\""+signedHeaders+"\";Signature=\""+signature+"\""; System.out.println(authorizationHeaderValue); String fullAuthorizationHeader = "Authorization :"+authorizationHeaderValue; System.out.println(fullAuthorizationHeader); } public static String getQueryString(String queryString) { String collect = Arrays.stream(queryString.split("&")).sorted().collect(Collectors.joining("&")); return collect; } public static PrivateKey loadRSAPrivateKey(String privateKeyString) { String trimmed = privateKeyString.replace("-----BEGIN PRIVATE KEY-----\n", "") .replace("-----BEGIN RSA PRIVATE KEY-----\n", "") .replace("-----END PRIVATE KEY-----", "") .replace("-----END RSA PRIVATE KEY-----", "") .trim(); byte[] decoded = Base64.getDecoder().decode(trimmed); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decoded); try { KeyFactory keyFactory = KeyFactory.getInstance(RSA); return keyFactory.generatePrivate(keySpec); } catch (Exception e) { throw new RuntimeException(e); } } public static String computeSHA256(InputStream inputStream) throws IOException { String sha256hex = DigestUtils.sha256Hex(inputStream); return sha256hex; } public static String computeSHA256(String inputData) throws IOException { String sha256hex = DigestUtils.sha256Hex(inputData); return sha256hex; } public static String sign(long timestamp, String keyId, String requestPath, String sortedQueryParams, String signedHeaders, String bodySHA256, PrivateKey privateKey) { String fullPayload = createFullPayload(timestamp, keyId, requestPath, sortedQueryParams, signedHeaders, bodySHA256); return sign(fullPayload, privateKey); } public static String createFullPayload(long timestamp, String keyId, String requestPath, String queryParams, String headerString, String body) { String headerStringToAppend = headerString != null && !headerString.isEmpty() ? headerString : "\n" + nullToEmpty(headerString); String fullPayload = timestamp+"\n"+keyId+"\n"+nullToEmpty(requestPath)+"\n"+nullToEmpty(queryParams)+headerStringToAppend+"\n"+nullToEmpty(body); return fullPayload; } private static String nullToEmpty(String value) { return value == null ? "" : value; } public static String sign(String payload, PrivateKey privateKey) { try { Signature signatureInstance = Signature.getInstance(SHA_256_WITH_RSA); signatureInstance.initSign(privateKey); signatureInstance.update(payload.getBytes(UTF_8)); byte[] signature = signatureInstance.sign(); return Base64.getEncoder().encodeToString(signature); } catch (Exception e) { throw new RuntimeException(e); } } }
To sign a multipart request compute SHA256 of the content of each file. For example to compute signature of multipart request below
curl --location --request POST 'http://localhost:8080/administration/ontology/bootstrap' \ --header 'Content-Type: application/n-triples' \ --header 'Accept: text/nquads' \ --form 'files=@"org-emp-img.ttl"' \ --form 'baseIRIForData="http://example.com/"' \ --form 'baseIRIForSchema="http://example.com/"' \ --form 'defaultLanguageCode="en"' \ --form 'idSetup="readOnly"' \ --form 'files=@"prefix-only.ttl"'
Compute signature by concatenating as shown below
timestamp+"\n"+keyId+"\n"+queryString+"\n"+headerString+"\n"+requestBodySHA256+”\n”+{hash of org-emp-img.ttl} +”\n”+baseIRIForData=http://example.com/+”\n”+baseIRIForSchema=http://example.com/+”\n”+defaultLanguageCode=en+”\n”+idSetup=readOnly+”\n”+{hash of prefix-only.ttl}
Note values in the curl example form fields have double quotes but in the signature payload there are no double quotes. In curl double quotes are required for shell and actual value which is sent to backend is without double quotes. So to compute signature use what is sent to the backend.
If you are managing taxonomies in Graphologi and want to setup API for the delivery of the taxonomies, you can do so by following the steps explained in Graphologi documentation section Integration with EasyGraph
Note key based authentication can be used for any other system integration.
To publish data from Graphologi to EasyGraph, integration endpoint format is as below. InstanceID and Dataset fields are required if those are enabled in EasyGraph setup. If you are using sandbox then InstanceID and Dataset information is shown in the top bar.
{BaseURL}/{InstanceID}/{Dataset}/administration/data/import?profile=graphologi&egSignatureKeyUUID=12345
Example
https://easygraph.graphifi.com/trial1/tZGv9Li7en/Graphologi-Integration-Demo/administration/data/import?profile=graphologi&egSignatureKeyUUID=a46978f0-f97f-43c4-8af6-85b0f1c73b33
If you are developing model ontology in Graphologi, you can push the model changes to EasyGraph after initial bootstrap. The example integration endpoint for same is below:
Example
https://easygraph.graphifi.com/trial1/tZGv9Li7en/Graphologi-Integration-Demo/administration/ontology/bootstrap?profile=graphologi&egSignatureKeyUUID=a46978f0-f97f-43c4-8af6-85b0f1c73b33&existingConfiguration=merge-classes-in-payload-leave-other
The EasyGraph Playground helps you to explore your HTTP and GraphQL APIs. It comes with many easy to use builders which can be used to build API requests using a form like interface.
API developers can use the playground to build example requests for the API which can then be shared with developers who are consumers of the API.
In our experience we have seen that consumers of an API can struggle to find out how to use it. The Playground is meant to help with exactly that problem - it is not just a testing tool.
To get started click 'Playground' in the dashboard as shown below.
If you have used an example ontology in the Bootstrap application you can automatically generate a workspace within the playground.
Click the button on left.
In the popup dialog leave the defaults and click
.Your screen should look as below.
Click on the workspace card to open it. Your screen should look as below
Within a workspace groups of requests are organised into 'scenarios'. A scenario will generally be a task that a developer needs to accomplish. A scenario will generally consist of multiple requests.
Select the 'Create features' scenario under the Scenarios tab. You should see a screenshot similar to that shown below.
Click button at the top to execute the scenario. This will run all the requests within the scenario in order, one after the other.
Next let us try using GraphQL. From the list of requests expand the one with the title 'ID provided in payload'. Your screen should look as below.
In the expanded request click the icon on the right-hand side of the screen. This should open the request settings dialog as shown below.
Change the mode to GraphQL and click https://easygraph.graphifi.com/graphql. If you click on the Request tab you will be able to see the GraphQL request details as in the screenshot below.
. You should see the endpoint URL change toClick the scenario button again. When all of the requests have completed you will see the GraphQL response under the Response tab as in the screenshot below.
Note that the 'Autogenerate Workspace' button is only available if you have used an example ontology.
Playground stores all the data in browser storage and different browsers has different storage limits.
To create your own workspace click button on the left and enter name and description of your workspace.
In a new workspace click the
button to add first scenario. button to add your first scenario. In the dialog enter a name and a description and then click the button. This will create a new scenario which will show under the Scenarios tab. To add more scenarios click the button.To add a first request to a scenario, select the required scenario, then click the button in the center of the Scenario Details screen. From the menu select the type of request you want to create.
With a reset request you can clear all the data stored in the backend. This is useful when you want to try the API with a limited amount of data.
A create request is used to create new resources. Once you add a create request you can build the payload of the request using the Build tab. Click the Build tab and then
. In the newly added block select the type of resource you want to create. Based on the type a form is displayed as in the example below. By default all the mandatory fields are added to the form. You can add other fields by clicking in the property block.To generate mock data you can click Mock setup.
. This will generate random values for all the fields in the form. To configure the strategy for mock value generation please refer to the section onYou can also use the Request tab to manually enter the body of the request. Note that if you have used the builder the request body is generated from it.
Note that in type selection some of the types might be disabled as shown in the screenshot below. This is due to the ID Setup as configured in the Bootstrap application.
A search request is used to search resources in a graph. You can build a search request using the tools in the Build tab.
Under this tab you can build the query parameters used in a search. Click on to add a block. In the Property field select the name of the property from the list or type a few characters to find a property. Once a property is selected then, depending on the type of property, a list of operators may be shown. Depending on which operator you select a Value field, Language Field and Object Field might be shown.
With the Text Search block you can specify the criteria for text search. You can select multiple properties to perform text search across. If you want to perform text search against all properties then leave this option empty. You can also specify the language for text search using the Language field. To add another value for text search click the
button. If you want to search multiple text values you can click to add more value fields.Search allows you to filter resources by specifying constraints on connected resources. Connected resources are resources connected via an object property. Using the builder you can easily build a query using the Matches operator. For example, let us say we want to build a query to find all organisations where its members have an image with width 100. Below are the steps to build such a query.
Using this tab you can build a Prefer header to specify the data that you want in the response. For example, let us say we want search to return both member and image data. You can build the request as below.
If you want a search response to return only specific properties you can select the 'Selected Properties' option in the Data Filter block. For example, you may want a search result to return description and name for organisations, any givenName property for member objects connected to any organisation as well as height and width properties from any ImageObject connected to a member. You can build the request as below.
Using this tab you can build facet parameters for a search. For example, let us say that with our previous search request we also want to facet on the organisation, description and member properties. You can build the request as below.
Using this tab you can build the sortBy parameter for search results sorting. The steps to build this parameter are the same as described in the above sections.
Using this tab you can specify the page, pageSize and countUpto parameters for a search. For each of these parameters there is a field under the Paging Counting tab as shown below. Simply enter the values for these fields. You can view the request parameters under the Request tab.
Using this tab you can specify the lang parameter for a search. If you start typing the language code autocomplete will show any matching codes. If you want to enter a language code other than those in the options list you can type the code and click "Add". You can view the lang parameter under the Request tab.
Using this tab you can specify the If-None-Match header and add a Prefer header to get etags for search results. If you add these headers you can view them under the Request tab.
Update requests are used to try out update features in the API. There is currently no builder for an update request but you can specify the body of the request under the Request tab.
Delete requests are used to try out delete features in the API. There is currently no builder for a delete request but you can specify the body of the request under the Request tab.
Batch requests are used to try out the batch features of the API. You can use the Build tab to build a body for resources to create and specify the context. To specify the update and delete parts of a payload you can edit the payload body under the Request tab.
To build scenarios for Search, Update, Delete and Batch you might want to use some values from previous request responses within a scenario. For example, in an update request you need to specify the eTag of the resource being updated. As eTags are returned in a response body a mechanism is required to store the value in a variable and then refer to these variables in subsequent requests. This can be done by setting variables under the Response tab. In the image below you can see two blocks at the end to set variables from a response body or a response header. Note that to set variables you need to run the request first.
To store a value of an eTag header in a variable first execute the request then click
. This will populate the Header Name and Preview Value fields. You need to enter a Variable Name that will be used to store the value. After typing the variable name you can then save the request.Similarly to setting variables from a response header, you can also set them from a response body. Click
and enter a Variable Name and a JSON Path. You will be able to see the current value for the JSON Path in the Preview Value field. After adding a variable remember to save the request otherwise you will lose any changes if you load another workspace or refresh the page.To use a variable in a request body enclose the variable name in double curly braces {{variable name}} as shown below.
You can also use variables in the builders. In the below screenshot the If None Match field value is a variable.
To preview the substituted value you can select 'Preview with Global Variables Substitution' under the Request tab as shown in the screenshot below.
As an API developer you might want to create examples to share with API users. The Playground allows you to export workspace and scenarios.
To export a workspace open it and click . This should download the workspace to your system.
To export a scenario select it and click .
To import a workspace click . This will open the import dialog. Click
or drag and drop a workspace file on to the appropriate area of the screen. The screenshot below shows the Select File step with a selected file.Click
to Preview the name and description of a workspace, along with its scenarios and requests. The screenshot below shows the Preview screen.Click
. This will show the Import Successful message.Click
to go to the Playground dashboard, where the newly imported workspace will show up.Scenarios can be only imported into a workspace. Therefore, to import scenarios first open a workspace and then click the Import button. This will open a dialog similar to workspace import. Note that you can import multiple scenarios.
Under the Mock Setup tab within a workspace you can control how mock data is generated for datatype properties. To change the default regular expression (regex) click the button in the appropriate property card. This will display a dialog where you can change the regex and test the values generated by it.
When you switch to GraphQL mode the Request tab shows the GraphQL query and variables editor. If you have built the request using the Build tab then, depending on the type of request, the GraphQL query is autogenerated and can be viewed under the Request tab. If you wish to manually create a query you can type it in the query block and specify any variables in the variables block.
If you execute a GraphQL request the Response tab shows the result of the request.
There are some differences in how various features work depending upon whether you are in HTTP API or GraphQL mode. For more details see the APIs section.
If you change mode from HTTP API to GraphQL for a search request then, by default, the generated GraphQL search query just selects __typename for egResults. To select other fields you will need to manually type the rest of the GraphQL query.
Explorer allows you to build a site for your data in the EasyGraph.
It comes with easy to use site builder. You can create multiple sites and you can also set a site as home page. If a site is set as home page any user who visit the home page of EasyGraph will see the site instead of EasyGraph management UI.
Bootstrap EasyGraph and in the load model step choose 'Graphologi Model'. For ID Setup step configure read only API. For more details see bootstrap.
Download UNESCO Thesaurus Turtle
Open System Manager and import UNESCO Thesaurus data into EasyGraph.
Open Explorer application and click
button. Enter 'UNESCO Thesaurus' as site name and click button.In the site configuration dialog configure as below:
Configure languages as shown in the screen shot below and click
You do not need to do anything just click
You do not need to do anything just click
Switch on 'Enable Language Selection'. Select 'skosPrefLabel' and 'skosAltLabel' properties as shown below.
Click on
button and configure the filter for 'type' as below. Note the 'Enable Facet' switch is on.Click on
button again and configure the filter as below. Note the 'Enable Facet' switch is onClick on
button again and configure the filter as below.Click on
button again and configure hidden filter as below.Click
In the tree on left hand side select 'Concept' and configure the view as below.
In the 'Other Properties' click
button to add a property. Click the button again and configure properties as below. Note 'Show Count' switch is on.In the 'Summary Section' configure as shown below.
Click
Click
Click Add Request button.
Configure the query as shown below.
Click on 'Paging Counting' button and set the page size to 12.
Click
Click
Click
Click
Click
You should see home page of the site as below. Try search or click on card to explore the data.
To create a site open Explorer application and click
button. Enter name and description of your site and click button. This should create the site and open site configuration dialog.Only root user or a user with Super Admin role can create and configure site.
All sites are shown on the explorer home page. To edit site name and/or description you can click edit icon button on site card. If you wish to delete a site the delete button is also available on site card.
The site configuration dialog has below sections:
In this section you can configure multiple language browse for your site. To configure multiple languages switch on 'Enable multilingual site browse' setting. With this setting enabled you can add languages for browse. With this configuration switched on site users will be able to select a browse language from configured languages list.
When 'Enable multilingual site browse' is on you can also switch on the setting to 'Enable multilingual UI configuration'. This will allow you to enter translations for various labels used in the site UI.
If the underlying data is not in multiple languages you leave the 'Enable multilingual site browse' switch off and just specify the default language code of the data.
Under basics section you can configure look and feel of the site. With these configuration you can create a site matching to your brand.
You can also show/hide buttons which are shown in the right pane below Filters pane.
To hide IRIs of linked resources you can change "Linked resources view type".
You can also turn on the feedback "Feedback Settings".
The switch for 'Set as home page and make settings public' is disabled on sandbox but if you are running EasyGraph in your own environment this option can be used to set a site as home page..
From the labels sections you can configure various messages and labels which are shown on the site. For a multilingual site you can also add translations.
Under this section you can configure main text search. By default text search is shown at the top. To show text search in search card you can switch on 'Show In Filters' setting.
If you select properties then text search is only performed against those properties.
From the filters section you can configure the filters which site user can use to search data. When configuring a filter you specify the property and operator for the filter. You can also enable facets for a filter.
As you configure filters 'Search Card Preview' on the left of page shows how the search card is going to look on the site.
From the data view section you can configure the display of search results and resource view page.
For each resource you can specify the title, image and description properties. These properties are then used to determine what data to show on search result cards.
You can specify multiple properties for each section. If the data is not available for one property then alternative property is used to render value on search result cards.
You can also add other properties and configure how to show these on card.
If there are some properties on resource data but you want to hide those properties, you can do so by clicking on property tab in the top left. This should show list off all the properties. You can hide a property by clicking on the switch next to property name. To add the property back again, you can click delete button next to property name on the right of the screen(Hidden Properties Section).
It is also possible to configure the order of the properites shown for a resource.Select the class from the left tree and on the right side details section scroll to the "Property Order" section. First add properties by clicking the Add button. After adding the properties you will be able to change the order of the properties and that is how the properties will show on the resource.
If you switch on 'Hide all other properites' then all other properties except the ones which are added in Property Order section are hidden from the view.
If a property is hidden as explained in "Hiding Properties From View" section above, adding a property to resource view won't show the property on resource. So if a property is not showing check it is not hidden.
Under this section you can configure queries or add other widgets to show data on home page of the site. When site user visit the home page these queries are run and cards or other widgets are shown.
For more details on configuration of the query please see search request
Under this section you can configure pages like About Us or API examples. Site users see these pages in the application bar.
To add a page click
button. Enter the page title. If the site is multilingual site you will be able to enter translations for the title. Click button.To add the content of the page click
button.From the page editor you can add content section, a data visualisation, graph visualisation, sheet or you can add API search examples.
The configuration is same as Menu pages and the difference is that these pages are not shown in menu. Instead you can create links from other pages to these pages
To save all the settings click 'Finish' button.
You can change the site configuration at anytime by clicking settings icon button. This opens same dialog as explained in the previous section.
As an admin you can edit the page while browsing the site. To enable Quick Page Editor mode click on your icon on the top right and enable quick edit switch as below:
Then hover your mouse pointer over any part of the page. You should see settings icon button.
For example to edit logo hover over the logo in top left of the home page. Then click settings cog icon button. You should see logo adjustment panel shows up as below:
Make the changes and lick Apply button to apply the changes.
When you click
in Home Page, Menu Page or Other Pages tab the same page editor is opened. Page editor has components panel as shown below.To add a component to the page, click on any component and the component is added to the page.Depending on the type of component you might want to configure the component further.
Click button. This should add a content editor component as shown below. You can add and edit content in the content editor. If you have configured a multi multilingual site then you can add all the translations as well.
Click button. This should open a select visualisation dialog. Select a previously saved visualisation and click open. This will embed the selected graph visualisation in the page.
Click button. This should open a select data visualisation dialog. Select a previously saved data visualisation and click open. This will embed the selected data visualisation in the page.
Click button. This should open a dialog to select from saved sheets. Select a sheet and click open button. This will embed the selected spreadsheet in the page.
Click button. This should open a dialog to select from saved sheets. Select a sheet and click open button. This will embed the selected spreadsheet in the page.
You can use this component to add link to other pages from a page. Make sure you have create at least one page in Menu Pages or Other Pages. Click button. This should open a "Pages Block Setup" dialog. Select the pages you want to create links to. Click Add button to add the page links block.
Click button and click "SEARCH" in the popup menu. This should add a request builder component in the page. Note that on Other Pages or Menu Pages you can choose to render the request data or as an API example.
To export a site go to the explorer home page and click export button on the site card. This should download the site to your system.
To import a site open explorer application and click import button in the left menu. Select the site file and follow the steps in dialog.
Note that as an read only user you can only browse the data but as an Admin you get the option so save the graph visualisation, data visualisation or spreadsheet.
To create and save a graph visualisation you can start from any data point and navigate the graph to add more nodes. You can also apply custom styles for the nodes and edges.Once you are happy you can click the Save button to save the visualisation.
A saved graph visualisation can be opened or it can be embedded in the pages.
For example if you want to create graph visualisation for a concept in your taxonomy, configure the site as explained in quick start section. Then search for the concept and then hover mouse over the card. You should see Visualise button as shown below:
Click Visualise button and this will open Graph Navigator. Add other nodes and edges or styles. Click the save button as shown in the shot below, and specify a name in the Save dialog.
Once a visualisation is saved you can open it by clicking "OPEN VISUALISATION" button or embed it in a page via page editor.
You can link multiple pre saved visualisations. For example if you want to open a saved visualisation on click of a node in a visualisation, as an admin user hover over the node in visualisation. This should show a settings button. Click the settings button and then configure On Node Click action to "Open Visualisation". In the Visualisation Select field you can select the visualisation you want to open on node click.
Instead of opening the another visualisation on node click you can also enable "Expand button" by clicking the switch in settings and configure action on the button click.
To create and save a data visualisation click "OPEN DATA VISUALISATION" button on the bottom left of home page.
This should open a data visualisation configuration page. All the data visualisations are driven by a SPARQL query. So write a SPARQL query to get the data for the visualisation.
Run the query and preview results in Data Preview panel.
In the Visualisation Preview panel click on settings panel.
In the settings panel you can configure the visualisation settings. You can choose type of visualisation and depending on the visualisation type you will be able to configure various settings.
Once you are happy with the visualisation, click Save icon button in the top bar. Enter a title and save.
Once a visualisation is saved you can open it by clicking "OPEN DATA VISUALISATION" button and select the saved visualisation in Select field in top or you can embed it in a page via page editor.
To create and save a spreadsheet click "OPEN SHEETS VIEW" button on the bottom left of home page.
Choose the Type of the data you want show on the sheet. Note you can choose multiple types and this will create multiple tabs on the sheet.
The UI is like a spreadsheet so you can rearrange the column, filter or sort data. Once you are happy with the data on sheet you can save the sheet.
Once a spreadsheet is saved you can open it by clicking "OPEN SHEETS VIEW" button and select a saved sheet. You can embed a saved sheet in a page via page editor.
You can configure EasyGraph to answer Natural language question using OpenAI. AI settings are available under Basics tab. Note AI settings section is enabled only if EasyGraph is started with openai.api.key.
To setup the OpenAI API key on OSX/Linux platform, edit conf/setenv.sh and add/update env variables exports as shown below
export OPENAI_API_KEY={KEY_VALUE}
To setup the OpenAI API key on Windows platform, edit conf/setenv.bat and add/update env variables exports as shown below
set OPENAI_API_KEY={KEY_VALUE}
Once you have setup OpenAI API key you will be able to see AI settings as shown in the shot below:
To enable the AI view for admin user select "Yes" for "Enable AI" switch and select a default AI model. The default base AI models list is controlled by "ai.base.models" property. You can set this property to add/remove base models.
To setup the base models on OSX/Linux platform, edit conf/setenv.sh and add/update env variables exports as shown below
export AI_BASE_MODELS=davinci-002,babbage-002,gpt-3.5-turbo-0125,gpt-3.5-turbo-1106,gpt-4o-2024-08-06,gpt-4o-mini-2024-07-18
To setup the base models on Windows platform, edit conf/setenv.bat and add/update env variables exports as shown below
set AI_BASE_MODELS=davinci-002,babbage-002,gpt-3.5-turbo-0125,gpt-3.5-turbo-1106,gpt-4o-2024-08-06,gpt-4o-mini-2024-07-18
If you use base models as it is natural language questions answering may not work. You can fine tune a base model with the example questions and queries. To fine tune a base model enable AI as explained above. Then as an admin click button in the main search bar. This will open the AI view. To fine tune a model you first need to create a training data. Click on the "Example Sets" tab. Click "Create New" icon button. Enter title in the dialog and click Save button. This should create a new Example Set and open it. To add an example question and query pair, click in the input box at the bottom and type a question in plain English and press enter. You should see that a query to answer the question is generated for you. As you might have used out of the box model the generated query may be wrong or may not answer the question. To fix the query click "Compact View" button at the top and edit query. To save query press ctrl+ Enter. Or if you want to edit the query with a SPARQL editor switch on "Advanced Editor".
To try fine tuning create at least 10 question and query pairs. More examples you can give the better the results will be.
Once you have example set created click on "Models" tab and click "Create New" button.This should open a Train Model dialog. Enter title for the model, choose a base model and choose Example Set. Then click "Train" button. This should start fine tuning of a model. Withing few minutes you should see the newly fine tuned model.
Once you have fine tuned a model successfully you can go back Basic setup of the site and choose this model to answer the natural language questions.
Once a model is fine tuned you might want to test the model quickly. For this you can create another Example Set. Then open a fine tuned model from the models tab. Click "Test" sub tab and then select the Example Set you created to test the model. This will show you the question and expected query. Click "Generate Message" button. You will see the quesry generated by the model and you can compare the generated query with expected query.
Site users can use "Sessions" tab to save the question and answers. To create a session click "Sessions" tab and then click "Create New" button. Type the question in the input field and press Enter. You should see a question and answer pair. All the question/answer pairs in a session are saved and user can come back and open these later. It is also possible to share the URL.
System Manager allows you to view and edit configurations created within EasyGraph.
The Home tab shows statistics about the configuration and CPU usage.
If you want to change the ID Setup after bootstrap you can do that under this tab.
The Classes tab allows you to view all the OWL classes in a configuration.This is for viewing purposes only.
The Shapes tab allows you to view and edit the SHACL shapes generated by the EasyGraph Bootstrap application. To edit a property in the shape click the button. This will open a property edit dialog as shown below.
What can be added/edited depends on the property type and ontology. Below is the list of options implemented.
If you want to change the Inverses after bootstrap you can do that under this tab.
Under the Rules tab you can define construct queries which can run on creation of or the updating of resources. The result of these queries is persisted in the database. This can be useful for search query performance tuning and generating other useful properties such as adding a created or updated time.
Note that SHACL validation runs on the results of any construct query plus any triples for create/update and validation will fail if a resource is not valid as per the shape.
To define a rule click the button. This will open the Create New Rule dialog.
Enter a value in the Label field to give a rule a name. Select the desired Run On options to specify if the rule should be fired on create, on update or for both operations. Select values for Membership Class to specify the types of resources for which this rule is applicable. Specify the construct query and click Create.
To understand how rules work let us create an example rule to add a dateCreated property for ImageObject class (assuming the payload does not specify it).
prefix ex: <http://example.com/> CONSTRUCT { ?s ex:dateCreated ?dateCreated } WHERE { ?s ?p ?o . MINUS { ?s ex:dateCreated ?dt } BIND(NOW() as ?dateCreated). }
Go to the Playground and create a resource of type ImageObject, without specifying any dateCreated value. Then search for the newly created ImageObject resource and you should see a dateCreated property.
Importing a configuration will wipe any existing configuration.
Configuration import allows you to load an entire API configuration. This is very useful if a developer of the API wants to share a configuration with API users. By importing a configuration, API users can recreate the same setup within EasyGraph that the API developer has created, including any manual changes.
You can only import a 'Full configuration' file generated using export.
To import a configuration click the
button under the Configuration tab under the Import tab. Select a configuration file from the file system dialog and click . You should see a confirmation message.To verify that all the configurations has been imported you can click on the other tabs in the System Manager and view imported configurations.
To import data select Data tab and click the
button. Select data file and click . You should see a confirmation message.Due to performance reasons, shapes validation is not performed on the imported data. So you need to make sure that imported data is valid as per the configuration. Also all the data is loaded in memory first and for large dataset you will need to configure more heap space for EasyGraph.
Export allows you to export a full or partial API configuration. Click on the Export tab. Choose an Export Type and a File Type and click
. This will download the configuration file to your file system.Under the Export tab you can also view or download the generated JSON-LD context file for the API configuration. Click the JSON-LD button and then either view the context file or click
.Authentication controls who can access EasyGraph API. EasyGraph use JWT tokens or key pair for authentication. If authentication is enabled then user can login with a post request to {base-url}/egmManagement/login for more details please see API section.
There are 3 configuration options for authentication.
When Authenticate all requests option is selected then all the API calls are authenticated using JWT token.
Or you can select Authenticate update requests only and allow read requests without authentication. This means public read API.. This option is useful if you want to setup public read only API for your dataset.
Or you can completely disable authentication by selecting Disable authentication for all requests.. For example you might want to use this option if you have AWS API Gateway fronting EasyGraph API and want to handle authentication through AWS API Gateway.
Authorisation is to control what an authenticated user can do. From the authorisation tab you can enable type of the authorisation you want to use on API calls.
Enable Create, Retrieve, Update and Delete Operation Based Authorisation option can be enabled to control which users are allowed to creation, retrieval, update and deletion of the resources.
Enable Data Class Based Authorisation option can be enabled to control which users are allowed to perform what type of operations on classes(type) of data.
Enable Endpoint Based Authorisation option can be enabled to control which users are allowed to perform actions on some of the admin API endpoints.
Users of the EasyGraph can be assigned roles from this tab. Depending on the authorisation settings, permissions can be configured for each role and then role can be assigned to users.
To add a new role click on the Add new role icon button on the roles screen. Enter role name and description in the dialog and click Create button. Your screen should look as below
To setup Operation Based Authorisation ensure that Enable Create, Retrieve, Update and Delete Operation Based Authorisation option is checked under the Authorisation tab. If the option is checked your screen should look as below.
To associate a permission click the checkbox for operation name.
To setup Class Based Authorisation make sure that Enable Data Class Based Authorisation option is checked under the Authorisation tab. Assuming that you have done boostrap with example ontology in Quick Start section, If the Class Based Authorisation is enabled your screen should look as below.
To associate a permission click the checkbox for operation name in the class tree.
To understand how role based access control works let us go through some examples. Follow the steps in Quick Start section and create dataset in your sandbox. Bootstrap dataset with example ontology by following steps Quick Start blocks in Bootstrap section of this documentation.
Go to User Management screen and create a new user named ReadOnlyUser. In the Datasets block select Can View checkbox against the dataset which you have setup above.
Open System Manager application.
Click Authentication menu option on left and select Authenticate all requests option.
Click Authorisation menu option on left and select Enable Create, Retrieve, Update and Delete Operation Based Authorisation option.
Click Roles menu option on left and create a new role named ReadOnlyRole. Role details for newly created role should show on the right side.
In the role details select Retrieve checkbox from the Operation Based Authorisation block.
In the role details, in Users block select Role Assigned checkbox for user ReadOnlyUserRole.
Logout and login with ReadOnlyUser user.
On home screen select dataset you have setup.
Open Playground application and autogenerate example workspace by following the steps in Quick start section in the Playground documentation. Open the workspace and run create examples. If you have followed all the steps you should see that Create requests fail for the user as shown below. This is because user does not have write permissions.
Next try to run Search basics example scenario. You should see that all the search requests succeed. This is because user has read permissions.
Login as root user and Go to User Management screen and create a new user named EditorUser. In the Datasets block select Can View checkbox against the dataset which you have setup above.
As explained in the previous section setup Authentication and Authorisation.
Create a new role with name EditorRole. Select Create, Retrieve and Update checkboxes and assign EditorRole to EditorUser as shown below.
Logout and login with EditorUser. Open Playground and run "Update features" scenario. As the user has permissions to create, retriev and update all requests except RESET should succeed as shown below.
Reset can only be done by a user with Super Admin permission. Please see Users section for more details.
Login as root user and Go to User Management screen and create a new user named OrganisationEditorUser. In the Datasets block select Can View checkbox against the dataset which you have setup above.
As explained in the previous section setup Authentication.
Setup Authorisation as shown below.
Create a new role with name OrganisationEditorRole.In the CLass Based Authorisation block select Create, Retrieve and Update checkboxes for Organisation and assign OrganisationEditorRole to OrganisationEditorUser as shown below.
Login with OrganisationEditorUser and run "Server side id generation" under "Create featrues" scenario. This should succeed. If you run "Multiple connected resources" request, it should fail as user does not have permission to create all types of resources in the payload.
As a root user you can create resource of type Organisation, ImageObject and Person. If you then login as OrganisationEditorUser and run search request you will see that only resources of type Organisation are returned.
Schema builder allows you to build a schema for your API.
Once you have built a schema you can set up your API by selecting the schema option in the bootstrap process.
To get started click Schema Builder in the dashboard. Your screen should look as below.
Click the
button and fill in the form as shown below.Name : Give your schema a name.
Namespace Prefix : A prefix is a short name for the base IRI. EasyGraph uses prefixes when there are conflicts in generating property and class names for IRIs. For more details see prefixes
Base IRI : The base IRI is used to generate IRIs for properties and classes defined in the schema.
Description : A description for your schema.
Click the
button to create a new schema. Your screen should look as shown below.To view/edit schema details you can click on schema name.
To view all the schemas click on the icon in the menu on the left.
In the new schema click
to add the first class. In the dialog enter a name and, if desired, a description and then click . This will create a new class which will show under the Classes tab. To add more classes click .To delete a class click Delete button in the class details.
Using graph view you can view the class hierarchy and how classes are connected to other classes through properties. To open the graph view click on the top right hand side of the screen.
To view details of any class click on the node in graph view.
To reset the graph click . For other options click the button. The screenshot below shows all the options.
To go back to the form view click on the top right of the screen.
Schema builder allows you to create a class hierarchy. To create a subclass hover over the class node and click as shown below.
This will open a dialog with options to create a new subclass or to choose an existing class to use as a subclass.
To create a new class as a subclass select the Create New Class option as shown below. Enter a name and, optionally, a description of the class and click the
button. To add multiple subclasses you can click . This will add the class and keep the dialog open to add additional subclasses.A subclass inherits properties from its super classes. To view all the inherited properties you can turn on the Inherited Properties switch.
To remove the relationship between a subclass and its superclass, hover over the subclass node and click . You can also remove the relationship by clicking on the delete button on the chip in the Hierarchy tab.
Note that in graph view you can hover over the edge connecting a subclass and its superclass and this will show the remove icon button.
To add a property to a class click
in the properties block on the right of the screen. In the dialog enter a name and, optionally, a description for the property. In the Property Type field select a type for the property.Object properties allow you to connect data of different types. For example, if you have a Person class and an Image class, then you can define an Object type property to link images to a person.
List allows you to create ordered lists. This uses rdf:List under the covers.
Use a datatype property for other class attributes.
If you do not want to define a datatype you can choose literal as the property type. This means that the value of this property can be a language tagged string, a string or a value with a datatype.
For example, if you want to add a givenName property to the Person class, enter "givenName" in the name field and select "String" in the property type field. Click the
button. Your screen should look as below.To remove a property from a class click the button in that property. Note that this will only remove the property from the selected class. If you want to delete a property from all the classes it is used on see the Delete Property section.
You can view a list of all the properties under the Properties tab as shown below.
To create a new property click the button and enter details in the dialog. The same property can be used in multiple classes.
To view property details click on the property. From the property details on the right you can change the property type and any inverse property.
To delete a property click in the property details.
Depending on the type of the property, constraints can be defined for that property as used on that class. Any API request not satisfying the constraints as defined on the property will be rejected.
If this value is set then a resource with this class type should have at least that number of values for this property.
To make a property mandatory you can set the Min count value to 1.
This is to set the constraint on the maximum number of values for a property.
This can be used to set a constraint on the value of string type properties.
This sets a constraint on the maximum number of characters that can occur in a property value.
This sets a constraint on the minimum number of characters that must occur in a property value.
For an object type property this sets a constraint on the type of class that can be connected via this property.
You can specify more than one type. If you do this means that resources with any of those types are permitted.
For list type properties this sets a constraint on the type of class that can be used for members of the list.
For object type properties an inverse property can be defined. For more details how inverse properties work in EasyGraph see Inverse.
You can export a schema by clicking the button. An exported schema can be imported into another schema or in the schema dashboard.
To import a schema into another schema first open the schema in which you want to import your schema. Then click the button in the left menu. This will open an import dialog. Click the
button or drag and drop a schema file onto the appropriate area of the screen. The screenshot below shows the Select File step with a selected file. .Click
to preview the name and description of schema along with its classes and properties. The screenshot below shows the Preview screen.To preview existing classes or properties along with the imported classes and properties click .
Click
. This will show an Import Successful message. Click and you should see the newly imported classes and properties.To import a schema as a new schema click the button in the left menu on the schema dashboard. The rest of the steps are the same as explained above. Once imported you will see the newly imported schema in the schema dashboard
For details on bootstrap please see Bootstrap
To bootstrap an API with a schema select the schema in the Load Model step of the bootstrap.
Once you have selected your schema you will see the name and description of the selected schema as shown below.
Click
and complete the rest of the steps as described in the bootstrap section.This section gives more details about the backend API and the features that are available. We recommended that before jumping to this section you try Quick start.
In HTTP API mode a client can specify the Accept and Content-Type headers which tell the server in which format a client would prefer the response and the format of the payload in any request body. If these headers are not specified then the default is application/ld+json. Other formats that are available for these headers are text/turtle and application/rdf+xml.
To create a resource through the HTTP API send a POST request to the {base-url}/graph endpoint with a payload in the body of the request. To understand the various create features try the 'Create features' scenario in an autogenerated workspace.
During the bootstrap, or from System Manager, you can configure the level in a class hierarchy for which IDs should be generated. This also controls at what level in class hierarchy resources can be created. In our example model ImageObject is a subclass of MediaObject but ID setup is turned on for ImageObject which means that only resources of type ImageObject can be created. If you switch on ID generation for MediaObject then you will be able to post resources of type ImageObject or MediaObject but IDs will be generated using the label 'mediaobject'. The easiest way to understand this is to try it out by making the change in a configuration and then creating resources using the Build tab in the Playground.
Search allows you to find, filter and retrieve resources. With search you can also fetch additional resources connected to those in any search result.
The endpoint for search is {base-url}/graph/search. This endpoint accepts various request parameters and headers which are explained below.
The query Parameter query is to specify any filters for a request. The syntax for the 'query' parameter is GraphQL query based. You can filter on resource properties or connected resource properties too. Below are examples for how to use these parameters. To understand it better you can also try running search request examples in an autogenerated workspace.
The facet query Parameter is used to specify the properties upon which you want to facet. The syntax for the facet parameter is based on GraphQL. Examples for how to use this parameter are given below. To understand it better you can also try search requests with facet examples in an autogenerated workspace.
The sort query Parameter is used to specify the order for search results. The syntax for the sort parameter is based on GraphQL. Examples for how to use this parameter are given below. To understand it better you can also try search requests with sorting examples in an autogenerated workspace.
page By default search returns a limited number of results. If you want to fetch a specific page of results you can specify the page parameter.
pageSize By default search returns a limited number of results. To return a larger or smaller number of results you can specify the pageSize parameter.
countUpto Counting a large number of results can slow down the performance of search and in most use cases counting all matching results is not required (because a user will never bother to go that far into the results). The parameter countUpto can be used to specify the maximum value for the field 'egTotalCount'. The response will also contain a boolean field 'egHasMoreToCount' to indicate that there are more results over and above the countUpto limit. There is a default limit of 'countUpto' and it is configurable in the backend. Note that if you try to fetch a non-existent page the value of the search result field 'egTotalCount' may be wrong. This is due to performance reasons.
lang For search and facets a language code is required for value comparisons of language type properties. The system default language (specified during bootstrap) is used for these comparisons. To override the system default language for a request, the 'lang' parameter can be specified.
Prefer The Prefer header can be used to specify which data should be returned from a search or to fetch eTags for a page of search results. Note that, by definition, it is optional for a server to honour the Prefer header (for instance a system might be designed not to compute a preference if under heavy load). If a server honours the header then the response header 'preference-applied' is returned to inform a client which preferences have been applied.
Preference return=representationis used to specify search response data preferences. If this preference is applied then the server will include a 'preference-applied' header with the value 'return=representation'. This preference can take two parameters. The 'data' parameter specified which connected resources or properties should be returned. The 'dataFilter' parameter specifies whether the server should only return paths (as opposed to objects). That is, return only those properties in the response which are specified in the 'data' parameter. For example, if a search request is to find organisations and we only want the organisation description property in the response the request will be as below
Prefer : return=representation;data="{description}";dataFilter=paths
If we want to get all the properties of an organisation and we also want members of an organisation in the response the header will be as below. Note that if the preference is honoured the egResults property in the response will contain a list of results matching search criteria and the egIsConnectedTo property will contain an ID indexed map of members of organisations in the search result.
Prefer : return=representation;data="{member}"
It is possible to go further in terms of defining the response. If you want the search result to return both description and name properties for Organisations, the givenName property for Member object resources connected to the Organisations and height and width properties from ImageObject resources connected to Members the header will be as below.
Prefer : return=representation;data="{ description name member { givenName image { height width }}}";dataFilter=paths
If you want the search result to return full objects for organisations in egResults and full objects for both members and images in egIsConnectedTo the header will be as below.
Prefer : return=representation;data="{ member { image } }"
The preference egETag=page can be used to fetch eTags for a page of search results. If this preference is applied then the server response will include a 'preference-applied' header with the value 'egETag=page'. For more details on how this is useful see the section on Conditional GET.
For an example you can try running 'Search on connected data' scenario in an autogenerated workspace.
If-None-Match This header value can be specified to perform a conditional GET request.
To update resources in HTTP API mode a PATCH request can be sent to the endpoint {base-url}/graph. In GraphQL the same thing can be done through update mutations. When you update a resource you might want to update a value of a property or you might want to remove it completely. You can see examples for updating resources in an autogenerated workspace under the scenario 'Update features'.
To solve the problem of lost updates each update request needs to specify eTags of any resources being updated. On the server side this value is compared against the eTag in the database and if the request value matches then the update request is processed. If it does not match the request is rejected.
To delete a value of a property from a resource use null as the value of the property in the payload.For example the payload below will delete the properties description, member and slogan.
{ "id": "http://example.com/organisation/12ee6359-5056-4ecb-ade2-adde0c84f940", "description": null, "member": null, "slogan": null, "egETag": "W/\"1589628122689\"" }
To update value of the property specify new value. This will result in replacement of old values with new value. Note that for language type properties and properties of type set/list entire value is replaced with new value.
For example if we have a resource as shown and we want to update description to add description with language code "it" and delete description with langauge code "en"
"description": { "es": [ "Hola mundo", "Hola prueba" ], "fr": "Bonjour tester" }
Patch request for same will be as below. Note that even though we are not changing anything for "es" we still need specify the values for "es".
"description": { "es": [ "Hola mundo", "Hola prueba" ], "en": "Hello test" }
We wanted to keep PATCH syntax simple and easy to understand for front end developers. So null value in PATCH payload with media type application/ld+json or application/vnd.graphifi.patch.ld+json is processed as deletion of the property. As concept of null is not applicable to RDF/XML and Turtle payload, media types application/rdf+xml and text/turtle are not supported for PATCH endpoint.
To delete resources in HTTP API mode DELETE request can be sent to endpoint {base-url}/graph. In GraphQL the same thing can be done through delete mutations. For examples see 'Delete features' scenario in autogenerated workspace.
EasyGraph automatically generates GraphQL schema and GraphQL spec compliant server endpoint is made available at {base-url}/graphql.
In playground you can try GraphQL and in autogenerated workspace for most of the requests you can change the mode and see GraphQL equivalent of HTTP API.
In GraphQL schema mutations to create resources start with 'create_'. To view the list of mutations you can explore GraphQL schema or try it from Playground.
Most of the options explained under HTTP API Search are also available in GraphQL mode. Only difference is how you specify these options. In GraphQL mode all the parameters are specified with 'search' query as shown in example below.
query search($query: String!, $page: Int = 1, $pageSize: Int = 10, $countUpto: Int = 10, $sortBy: String!, $lang: String!, $facet: String!, $labelPropertyLang: String!) { search(query: $query, page: $page, pageSize: $pageSize, countUpto: $countUpto, sortBy: $sortBy, lang: $lang) @hint(queryType: PATHS) { egHasNextPage egHasMoreToCount egTotalCount egFacets(query: $facet, labelPropertyLang: $labelPropertyLang) { egFacetLabel egFacetResults { egFacetValue { type value } egFacetValueCount egFacetValueLabel { lang value } } } } }
{ "query": "{ member{ image } }", "facet": "{ givenName }", "sortBy": "{ givenName }", "page": "2", "pageSize": "2", "countUpto": "100", "lang": "fr" }
A GraphQL query can contain details about which properties are to be returned. Below example shows how to fetch some of the properties of Organisation and it'smembers. To some extent it is similar to Prefer header 'return=representation' in HTTP API.
{ search(query: "{ type(eq:[\"Organisation\"] ) }") { egHasNextPage egHasMoreToCount egTotalCount egResults { __typename ... on Organisation { id type egETag description { lang value } member { id egETag givenName } } } } }
In GraphQL schema mutations to update resources start with "update_". To view the list of mutations you can explore GraphQL schema or try it from Playground.
In GraphQL schema mutations to delete resources start with "delete_". To view the list of mutations you can explore GraphQL schema or try it from Playground.
Language type properties are serialised differently in GraphQL and HTTP API. Reason for this is that in HTTP API language type property values are serialised as language container as shown below.
"description": { "en": [ "Hello world", "Hello test" ], "fr": "Bonjour tester" }
It is not possible to define language container with GraphQL schema. So in GraphQL mode all the language type property values are returned as object containing lang and value property as shown below.
"description": [ { "lang": "en", "value": "Hello world" }, { "lang": "en", "value": "Hello test" }, { "lang": "fr", "value": "Bonjour tester" } ]
For create and update operations same difference applies.
As GraphQL does not allow union for input types if a object property can be assigned more than one class types then in GraphQL objects cannot be nested in create payload. You can still connect resources by IDs. However this means ids needs to be generated on client side.
There is no Batch API in GraphQL. However GraphQL mutation query can execute multiple update operations so HTTP Batch API can be converted to GraphQL mutation to achieve the same result.
Async request are not supported in GraphQL.
At the moment GraphQL schema is generated with union. Based on the feedback and actual use cases we might add option to generate schema with interfaces.
As GraphQL server endpoint is spec compliant introspection works out of the box. Below is the example of type introspection with search results.
{ search(query: "{ type(eq:[\"Person\" \"Organisation\" \"ImageObject\"] ) }") { egHasNextPage egHasMoreToCount egTotalCount egResults { __typename ... on Person { id } ... on Organisation { id } ... on ImageObject { id } } } }
Introspection also works with schema. Query below is example of schema introspection.
query IntrospectionQuery { __schema { types { kind name description } } }
Below is the example of search with FragmentSpread. If you have bootstrapped with example ontology you can try it from playground.
{ leftSearch : search(query:"{ givenName(eq:[\"Left Org Member\"] ) }") { egResults { ... personFields } } rightSearch : search(query:"{ givenName(eq:[\"Right Org Member\"] ) }") { egResults { ... personFields } } } fragment personFields on Person { id givenName }
Assuming there is no data matching the search, response for above request will look as below. As you can see from response both leftSearch and rightSearch are returned in the response.
{ "data": { "leftSearch": { "egResults": [] }, "rightSearch": { "egResults": [] } } }
As per GraphQL spec EasyGraph return errors in response. Wherever possible error message property will contain HTTP API code and phrase. Other details about the error are returned in extensions as shown below.
{ "errors": [ { "message": "reason : 'FORBIDDEN' httpStatusCode : '403'", "extensions": { "id": "_:node1e82c5uqnx8120", "type": "EgApiError", "rdfsLabel": { "lang": "en", "value": "UUID values [da2bfd55-d616-4d7d-941a-2787d3e0f093, 35334a2d-10d1-4cba-833e-fcef9c6d7cb6, 367a6c56-9255-4d06-852a-47e492b5f5ff] are already used for other resources." } } } ] }
Batch API allows you to perform create, update and delete in one HTTP API call. Depending on the feature of underlying database used with EasyGraph this means that entire operation can be executed in one transaction. For examples see requests under 'Batch API features' in autogenerated workspace.
In GraphQL, Batch API equivalent is to send multiple mutation operations in one call. For examples change the request mode to GraphQL for requests under 'Batch API features' in autogenerated workspace.
Depending on the size of update batch api might take some time to process. To wait long on client side with synchronous calls for the large operation to finish can cause many problems e.g. bad UI experience and connection timeouts etc. To solve these problems Batch API also supports respond-async preference. When async request is accepted by the server a response code of 202 is returned along with the activity in the response. Returned activity contains a property egStatus to indicate the status of the request. Initially the egStatus will be https://easygraph.graphifi.com/schema/eg/validating and if the update call succeeds activity egStatus will change to https://easygraph.graphifi.com/schema/eg/success. In case operation fails the egStatus will change to https://easygraph.graphifi.com/schema/eg/failed.
Client can poll to keep searching for the activity to get the updated egStatus. For examples see requests under 'Batch API async features' in autogenerated workspace.
There can be a use case where client might want to search the batch operation by some client generated ID. For these use cases client can pass 'activityContext' parameter to 'respond-async' preference. Value of this parameter must be a valid IRI and it maximum limit is 5. If a request is sent with 'activityContext' then values of this parameter are added to activity property named egActivityContext. A client can filter activity search request to find all the activities for a 'activityContext'.
For async request there are chances that request may fail when it is processed in background. If a request fails then egStatus is set to https://easygraph.graphifi.com/schema/eg/failed and property egFailureReason will contain all the details about failures. For example if there are SHACL validation errors then egFailureReason will contain SHACL validation report.
For each API call for create, update and delete EasyGraph records what IRI's has been changed in a resource of type EgApiActivity. Below are the properties which are added to EgApiActivity
For examples see requests under scenario 'Activities' in autogenerated workspace.
For async batch api requests, activity of type EgAsyncApiActivity is generated. EgAsyncApiActivity is sub class of EgApiActivity and it contains below extra properties.
EasyGraph admin API can be used to perform API admin functions programmatically.
API Endpoint to bootstrap EasyGraph from ontology is {base-url}/administration/ontology/bootstrap
Body of the request should be multipart request with below request parameter.
Below is the curl example to bootstrap with example ontology. Please replace value of JWT_TOKEN and PATH_TO_FILE before running the request.
curl --request POST 'http://localhost:9982/TestDataset/administration/ontology/bootstrap' --header 'Authorization: Bearer {JWT_TOKEN}' --form 'files=@"{PATH_TO_FILE}/example-ontology.ttl"' --form 'baseIRIForData=http://example.com/data/' --form 'baseIRIForSchema=http://example.com/schema/' --form 'defaultLanguageCode=en' --form 'enableDataReset=YES' --form 'idSetup=lowestClasses'
Or if you use Postman below is how the request looks like in Postman. Please note you will need to add Authorization header with value "Bearer {JWT_TOKEN}" under the header tab.
To regenerate API from changed model endpoint is same as bootstrap endpoint but you will need to specify value for existingConfiguration parameter. To wipe existing configuration and bootstrap again specify "wipe". To load partial model and keep existing model and merge into existing configuration specify "merge-classes-in-payload-leave-other". To load complete model and merge manual changes specify "merge". Below is the curl example
curl --request POST 'http://localhost:9982/TestDataset/administration/ontology/bootstrap' --header 'Authorization: Bearer {JWT_TOKEN}' --form 'files=@"{PATH_TO_FILE}/example-ontology.ttl"' --form 'existingConfiguration=merge-classes-in-payload-leave-other'
API configuration resources are stored in the same dataset where data is stored. Endpoint for configuration management is {base-url}/administration/configuration. A Super Admin user can execute requests against this endpoint.
To create/update a configuration resource use PUT request. Below is example to create a Role.
curl 'http://localhost:9982/TestDataset/administration/configuration' \ -X 'PUT' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"id":"https://easygraph.graphifi.com/data/role/d5e41983-1b36-4e82-88ee-fcb9154018ba","type":["EgRole"],"egLabel":"TestRole","egDescription":"","@context":"http://localhost:9982/egContext/eg-v1.jsonld"}'
Below example is to associate a role to a user
curl 'http://localhost:9982/TestDataset/administration/configuration' \ -X 'PUT' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"id":"https://easygraph.graphifi.com/data/role/d5e41983-1b36-4e82-88ee-fcb9154018ba","type":"EgRole","egDescription":"","egIsConfigurationResourceOf":"https://easygraph.graphifi.com/data/api-configuration/9615d3a3-d0f4-49ac-8ffa-138fe699ab11","egLabel":"TestRole","egAssignedTo":["https://easygraph.graphifi.com/data/user/1ddcdde6-14dd-4ed2-91fd-ec4dd2812e4d"],"@context":"http://localhost:9982/egContext/eg-v1.jsonld"}'
To retrieve all the API configuration execute GET against configuration endpoint.
To wipe all the existing configuration and import new configuration endpoint is {base-url}/import/configuration. Specify the configuration in the payload and run a POST request.
Endpoint for dataset management is {base-url}/egmManagement/dataset. Below are the examples
To create a dataset
curl 'http://localhost:9982/egmManagement/dataset?' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"@context":"http://localhost:9982/egmManagement/egContext/api.jsonld","type":"Dataset","label":"DatasetLabel","description":"Dataset description."}'
To GET all datasets
curl 'http://localhost:9982/egmManagement/dataset/search?' \ -H 'Authorization: Bearer {JWT_TOKEN}'
To update description
curl 'http://localhost:9982/egmManagement/dataset' \ -X 'PATCH' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"@context":"http://localhost:9982/egContext/eg-v1.jsonld","id":"https://easygraph.graphifi.com/data/dataset/bcbc0ada-fac0-4305-912d-d8db5d3ad6d7","egETag":"W/\"1619430452161\"","description":"Description"}'
To delete a dataset
curl 'http://localhost:9982/egmManagement/dataset' \ -X 'DELETE' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"@context":"http://localhost:9982/egContext/eg-v1.jsonld","id":"https://easygraph.graphifi.com/data/dataset/bcbc0ada-fac0-4305-912d-d8db5d3ad6d7","egETag":"W/\"1619430452161\""}'
Endpoint for user management API is {base-url}/egmManagement/user. Below are the examples
To create a user
curl 'http://localhost:9982/egmManagement/user?' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"type":["User"],"username":"TestUser","password":"TestUser1$","description":"A test user.","@context":"http://localhost:9982/egmManagement/egContext/api.jsonld"}'
To search/get user. Please see Search for details. In the request specify type value "User".
To set permission for user to view a dataset.
curl 'http://localhost:9982/egmManagement/user?' \ -X 'PATCH' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"@context":"http://localhost:9982/egmManagement/egContext/api.jsonld","id":"https://easygraph.graphifi.com/data/user/1ddcdde6-14dd-4ed2-91fd-ec4dd2812e4d","egETag":"W/\"1619430944595\"","canView":["https://easygraph.graphifi.com/data/dataset/edef38cd-751f-4def-8d2f-e7d86957f6c5"]}'
To delete a user
curl 'http://localhost:9982/egmManagement/user?' \ -X 'DELETE' \ -H 'Authorization: Bearer {JWT_TOKEN}' \ -H 'Content-Type: application/ld+json' \ --data-raw '{"@context":"http://localhost:9982/egmManagement/egContext/api.jsonld","id":"https://easygraph.graphifi.com/data/user/1ddcdde6-14dd-4ed2-91fd-ec4dd2812e4d","egETag":"W/\"1619430944595\""}'
For both create and update requests, resources are validated to check if there is any SHACL constraint violation. If create/update request violates any constraint defined in SHACL shape then request is rejected and SHACL report is returned in the response.
With Conditional Requests you can specify eTag as If-None-Match header value for search and result is returned only if server side eTag value is different. This is very useful for caching. Scenario 'Search and conditional GET' in autogenerated workspace has examples for it.
Behaviour of the text search depends on the features provided by backend database. If the underlying database does not support text search then SPARQL regex function is used. Note that depending on the size of the database text search performance can with SPARQL regex can be very slow.
EasyGraph can be easily configured to work with any triple-store which provides SPARQL HTTP endpoint. We have also implemented some custom repository connectors for StarDog, MarkLogic, Fuseki and GraphDB and it is very easy to customise the repository layer to utilise db specific optimisations. For more details please get in touch with us.
Below are the main points about how SHACL shapes are generated from OWL.
This section gives details about assumptions and some of the limitations.
Blank nodes are not supported at the moment. In our experience blank nodes add complexity and API becomes difficult to understand. You can still use RDF List.
Level of ACID compliance depends on database under the hood.
Multiple types for a resource are not supported at the moment. That is you cannot specify more than one type for a resource in the payload. Reason this is not allowed is because GraphQL schema restrictions.
All the property values are serialised as strings. However JSON-LD context files give details about datatype of property value.
SPARQL endpoint is disabled by default, to enable it set the properties as below.
export EG_SPARQL_ENDPOINT_READ_ENABLED=true export EG_SPARQL_ENDPOINT_UPDATE_ENABLED=true
set EG_SPARQL_ENDPOINT_READ_ENABLED=true set EG_SPARQL_ENDPOINT_UPDATE_ENABLED=true
You can also use Endpoint Based Authorisation to control access to SPARQL endpoint. For more details please see Authorisation section.
Badly written SPARQL queries can cause performance issue and SPARQL update can wipe entire database.
To Launch SPARQL console click on the SPARQL card in the dashboard. You should see console as shown below.
If Endpoint Based Authorisation is enabled make sure your user has role with POST QUERY permission for read queries and POST UPDATE query permission for update query for SPARQL endpoint. Without the permissions user will get 403 Forbidden message in response. An example role configuration is shown in the screen shot below.
All the queries are persisted in browser local storage. If multiple dataset are enabled then queries are executed against selected dataset.
To run EasyGraph locally you will need following
java -version
Go to https://easygraph.graphifi.com
To sign up click on the
button and fill the sign up form. Once you have signed up you can can login using your username and password.If you want to use your LinkedIn account, you must accept the Terms and Conditions. This will enable the
button. Click on it to complete the login process.Once logged in select 'Download' option and download EasyGraph by clicking the
button.EasyGraph package comes with RDF4J native store. To start EasyGraph with RDF4J native store follow the steps below
README.txt conf data easygraph.jar run-easygraph.bat run-easygraph.sh
Once you have EasyGraph running follow the steps in Bootstrap
EasyGraph can be configured to store data in Stardog. Below are the steps to run EasyGraph with Stardog.
Shot below shows old version of StarDog webconsole.
export EG_MULTIPLE_DATASETS=false export DB_IMPLEMENTATION=stardog_triplestore export DB_SERVER_REPOSITORY_AUTOCREATE=false export MANAGEMENT_DB_IMPLEMENTATION=stardog_triplestore export MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false export SPRING_PROFILES_ACTIVE=stardog_triplestore export DB_SERVER_URL=http://localhost:5820/ export DB_SERVER_REPOSITORYID=egData export DB_USERNAME=admin export DB_PASSWORD=admin export MANAGEMENT_DB_SERVER_URL=http://localhost:5820/ export MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement export MANAGEMENT_DB_USERNAME=admin export MANAGEMENT_DB_PASSWORD=admin
set EG_MULTIPLE_DATASETS=false set DB_IMPLEMENTATION=stardog_triplestore set DB_SERVER_REPOSITORY_AUTOCREATE=false set MANAGEMENT_DB_IMPLEMENTATION=stardog_triplestore set MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false set SPRING_PROFILES_ACTIVE=stardog_triplestore set DB_SERVER_URL=http://localhost:5820/ set DB_SERVER_REPOSITORYID=egData set DB_USERNAME=admin set DB_PASSWORD=admin set MANAGEMENT_DB_SERVER_URL=http://localhost:5820/ set MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement set MANAGEMENT_DB_USERNAME=admin set MANAGEMENT_DB_PASSWORD=admin
If you have changed Stardog default port, username or password then make sure you set the EasyGraph properties accordingly.
We have tested EasyGraph with Stardog version 7.6.2
For default EasyGraph username and password see RDF4J
Once you have EasyGraph running follow the steps in Bootstrap
EasyGraph can be configured to store data in MarkLogic. Below are the steps to setup EasyGraph with MarkLogic.
mlAppName=egData mlHost=localhost mlUsername=admin mlPassword=admin mlRestPort=8251
export EG_MULTIPLE_DATASETS=false export DB_IMPLEMENTATION=marklogic_triplestore export DB_SERVER_REPOSITORY_AUTOCREATE=false export MANAGEMENT_DB_IMPLEMENTATION=marklogic_triplestore export MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false export SPRING_PROFILES_ACTIVE=marklogic_triplestore export DB_SERVER_HOST=localhost export DB_SERVER_PORT=8251 export DB_USERNAME=admin export DB_PASSWORD=admin export MANAGEMENT_DB_SERVER_HOST=localhost export MANAGEMENT_DB_SERVER_PORT=8252 export MANAGEMENT_DB_USERNAME=admin export MANAGEMENT_DB_PASSWORD=admin
set EG_MULTIPLE_DATASETS=false set DB_IMPLEMENTATION=marklogic_triplestore set DB_SERVER_REPOSITORY_AUTOCREATE=false set MANAGEMENT_DB_IMPLEMENTATION=marklogic_triplestore set MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false set SPRING_PROFILES_ACTIVE=marklogic_triplestore set DB_SERVER_HOST=localhost set DB_SERVER_PORT=8251 set DB_USERNAME=admin set DB_PASSWORD=admin set MANAGEMENT_DB_SERVER_HOST=localhost set MANAGEMENT_DB_SERVER_PORT=8252 set MANAGEMENT_DB_USERNAME=admin set MANAGEMENT_DB_PASSWORD=admin
If you have changed port, username or password then make sure you set the EasyGraph properties accordingly.
We have tested EasyGraph with MarkLogic version 10.0-6.3
For default EasyGraph username and password see RDF4J
Once you have EasyGraph running follow the steps in Bootstrap
EasyGraph can be configured to store data in Fuseki. Below are the steps to run EasyGraph with Fuseki.
./fuseki-server --set tdb:unionDefaultGraph=true
export EG_MULTIPLE_DATASETS=true export DB_IMPLEMENTATION=fuseki_triplestore_multiuser export MANAGEMENT_DB_IMPLEMENTATION=fuseki_triplestore export SPRING_PROFILES_ACTIVE=fuseki_triplestore_multiuser export DB_SERVER_URL=http://localhost:3030/ export DB_SERVER_REPOSITORYID=egData export MANAGEMENT_DB_SERVER_URL=http://localhost:3030/ export MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement
export EG_MULTIPLE_DATASETS=false export DB_IMPLEMENTATION=fuseki_triplestore export MANAGEMENT_DB_IMPLEMENTATION=fuseki_triplestore export SPRING_PROFILES_ACTIVE=fuseki_triplestore export DB_SERVER_URL=http://localhost:3030/ export DB_SERVER_REPOSITORYID=egData export MANAGEMENT_DB_SERVER_URL=http://localhost:3030/ export MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement
set DB_IMPLEMENTATION=fuseki_triplestore_multiuser set MANAGEMENT_DB_IMPLEMENTATION=fuseki_triplestore set SPRING_PROFILES_ACTIVE=fuseki_triplestore_multiuser set DB_SERVER_URL=http://localhost:3030/ set DB_SERVER_REPOSITORYID=egData set MANAGEMENT_DB_SERVER_URL=http://localhost:3030/ set MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement
set EG_MULTIPLE_DATASETS=false set DB_IMPLEMENTATION=fuseki_triplestore set MANAGEMENT_DB_IMPLEMENTATION=fuseki_triplestore set SPRING_PROFILES_ACTIVE=fuseki_triplestore set DB_SERVER_URL=http://localhost:3030/ set DB_SERVER_REPOSITORYID=egData set MANAGEMENT_DB_SERVER_URL=http://localhost:3030/ set MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement
This section assumes you are running Fuseki with default settings. If you have changed port then make sure you set the EasyGraph properties accordingly.
We have tested EasyGraph with Fuseki version 3.16.0
For default EasyGraph username and password see RDF4J
Once you have EasyGraph running follow the steps in Bootstrap
EasyGraph can be configured to store data in GraphDB. Below are the steps to run EasyGraph with GraphDB.
export EG_MULTIPLE_DATASETS=false export DB_IMPLEMENTATION=sparql_http_triplestore export DB_SERVER_REPOSITORY_AUTOCREATE=false export MANAGEMENT_DB_IMPLEMENTATION=sparql_http_triplestore export MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false export SPRING_PROFILES_ACTIVE=sparql_http_triplestore export DB_SERVER_URL=http://localhost:7200/ export DB_SERVER_REPOSITORYID=egData export MANAGEMENT_DB_SERVER_URL=http://localhost:7200/ export MANAGEMENT_DB_SERVER_REPOSITORYID=egData
set EG_MULTIPLE_DATASETS=false set DB_IMPLEMENTATION=sparql_http_triplestore set DB_SERVER_REPOSITORY_AUTOCREATE=false set MANAGEMENT_DB_IMPLEMENTATION=sparql_http_triplestore set MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false set SPRING_PROFILES_ACTIVE=sparql_http_triplestore set DB_SERVER_URL=http://localhost:7200/ set DB_SERVER_REPOSITORYID=egData set MANAGEMENT_DB_SERVER_URL=http://localhost:7200/ set MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement
This section assumes you are running GraphDB with default settings. If you have changed GraphDB port then make sure you set the EasyGraph properties accordingly.
We have tested EasyGraph with GraphDB version 10.6.1
For default EasyGraph username and password see RDF4J
Once you have EasyGraph running follow the steps in Bootstrap
EasyGraph can be configured to run with any store which provides SPARQL HTTP repository. Please see GraphDB section above. You just need to set the properties to point to SPARQL endpoint.
EasyGraph can be configured to run with SPARQL endpoint. For example using this setup you can use AWS Neptune as backend.
export EG_MULTIPLE_DATASETS=false export DB_IMPLEMENTATION=sparql_endpoint_triplestore export DB_SERVER_REPOSITORY_AUTOCREATE=false export MANAGEMENT_DB_IMPLEMENTATION=rdf4j_nativestore_triplestore export MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=true export SPRING_PROFILES_ACTIVE=sparql_endpoint_triplestore export DB_SERVER_URL=https://{WRITE_ENDPOINT_NAME}:8182/sparql export MANAGEMENT_RDF4J_NATIVESTORE_FILEPATH=data export MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement
export EG_MULTIPLE_DATASETS=false export DB_IMPLEMENTATION=sparql_endpoint_triplestore export DB_SERVER_REPOSITORY_AUTOCREATE=false export MANAGEMENT_DB_IMPLEMENTATION=sparql_endpoint_triplestore export MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false export SPRING_PROFILES_ACTIVE=sparql_endpoint_triplestore export DB_SERVER_URL=https://{WRITE_ENDPOINT_NAME}:8182/sparql export MANAGEMENT_DB_SERVER_URL=https://{MANAGEMENT_WRITE_ENDPOINT_NAME}:8182/sparql
set EG_MULTIPLE_DATASETS=false set DB_IMPLEMENTATION=sparql_endpoint_triplestore set DB_SERVER_REPOSITORY_AUTOCREATE=false set MANAGEMENT_DB_IMPLEMENTATION=rdf4j_nativestore_triplestore set MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=true set SPRING_PROFILES_ACTIVE=sparql_endpoint_triplestore set DB_SERVER_URL=https://{WRITE_ENDPOINT_NAME}:8182/sparql set MANAGEMENT_RDF4J_NATIVESTORE_FILEPATH=data set MANAGEMENT_DB_SERVER_REPOSITORYID=egmManagement
set EG_MULTIPLE_DATASETS=false set DB_IMPLEMENTATION=sparql_endpoint_triplestore set DB_SERVER_REPOSITORY_AUTOCREATE=false set MANAGEMENT_DB_IMPLEMENTATION=sparql_endpoint_triplestore set MANAGEMENT_DB_SERVER_REPOSITORY_AUTOCREATE=false set SPRING_PROFILES_ACTIVE=sparql_endpoint_triplestore set DB_SERVER_URL=https://{WRITE_ENDPOINT_NAME}:8182/sparql set MANAGEMENT_DB_SERVER_URL=https://{MANAGEMENT_WRITE_ENDPOINT_NAME}:8182/sparql
For default EasyGraph username and password see RDF4J
As Neptune endpoint is HTTPS you can't use tunnel only to connect from your local. You will need to setup tunnel and hostname. Please see https://serverfault.com/questions/347499/how-to-assign-a-hostname-to-ssh-tunnel .
Once you have EasyGraph running follow the steps in Bootstrap
If you have some basic idea of how to launch stack in AWS using cloudformation, You can launch EasyGraph in you own AWS account for trial. This is useful if you want to try EasyGraph with large instances and upload bigger datasets. This also gives you quick idea about how you can set up EasyGraph in cloud. Please note that the cost to you will depend on the configuration you choose and as the setup will be running in your account you will be paying for it.
Cloud formation templates we provide are for trial only and setup is not secure. If you need help for production setup or want to try EasyGraph in a secure setup, please get in touch with us.
To launch stack, follow the steps in Quick start section and login to your account. On the account home page choose Try In AWS option.
For default EasyGraph username and password see RDF4J
Once you have EasyGraph running follow the steps in Bootstrap
To delete the stack just delete main stack from AWS console.
Please note that this setup is not secure. If you need help for production setup or want to try EasyGraph in a secure setup, please get in touch with us.
AWS API Gateway has lots of features to control Caching, API throttling and Security etc. If you want to setup AWS API Gateway in front of EasyGraph fill rest of the form as explained in previous section, expand "Advanced Settings" block and click "Create API Gateway" as shown in screen shot below.
Create stack and once the stack creation is complete you can get the endpoint to access EasyGraph as shown in the screen shot below. The screen shot also shows all the nested stacks as well.
Click on the URL in outputs. This should open EasyGraph login page. If you do not see the login page wait for 10 minutes and refresh.
For default EasyGraph username and password see RDF4J
Once you have EasyGraph running follow the steps in Bootstrap
Please note that although communication with API gateway is over HTTPs still this setup is not secure. If you need help for production setup or want to try EasyGraph in a secure setup, please get in touch with us.
For resilience and high availability select "Two AZ With Apache Jena Fuseki" option in the "Choose Setup Type" field. In this setup Fuseki data is stored on AWS EFS and EasyGraph instances are spread across two availability zones. Still there is one Fuseki instance but if one availability zone goes down AWS autoscaling brings up another Fuskei instance in another availability zone. As Fuseki data is stored in EFS the file system automatically gets mounted to the data directory of new instance.
As there are more than one EasyGraph instances in this setup, a load balancer is also created to distribute the traffic.
If you want you can also setup AWS API gateway with this setup from the "Advanced Settings" block.
This setup is for trial only and not suitable for production due to security reasons. Also note that this setup will cost more in comparison to setup in previous section as it creates more AWS resources.
For highest level of resilience and very high availability select "Two AZs With AWS Neptune" option in the "Choose Setup Type" field. In this setup AWS Neptune is used as backend to store all the data. You can also setup database replica by clicking "Create Replica" field under the "Database Configuration".
This setup is for trial only and not suitable for production due to security reasons. Also note that this setup will cost more in comparison to setup in previous sections as it creates more AWS resources and cost of AWS Neptune adds up into the cost.
By using settings in this section you can setup EasyGraph in a secure manner.
If you have a domain and you have HTTPS certificate managed in AWS certificate manager then you can specify the certificate ARN in "SSL Certificate ARN" field. This certificate will be used by the ELB for TLS. Then you can point the domain to ELB DNA created by the stack. You will also need to specify the same domain URL in "API Base URL" field.
EasyGraph use JWT for authentication. You can store JWT secret key in AWS Secret Manager and specify the ARN of the secret manager in "Secret Manager ARN" field. Screen shot below shows how the value should be in Secret Manager.
If Secret Manager ARN value is specified, IAM permissions are given to EasyGraph instance to access Secret Manager and startup script loads this key into EasyGraph.
With advanced settings EasyGraph setup is fairly secure. If there is requirement for even higher level of security please get in touch with us.