ozwillo / ozwillo-datacore

Ozwillo Datacore is a Cloud of shared Open Linked Data. Its goal is cross-business data collaboration and integration. By linking data from different business together, it allows creating value by developing new Ozwillo services on top of it.
http://www.ozwillo.com
GNU Affero General Public License v3.0
3 stars 2 forks source link

Build Status Project Stats

About Ozwillo Datacore

Ozwillo Datacore is a Cloud of shared Open Linked Data.

Its goal is cross-business data collaboration and integration. By linking data from different business together, it allows creating value by developing new Ozwillo services on top of it.

To interact and scale up, it uses Web technologies (HTTP REST API, OAuth2) and architecture (sharding and replication, client-side caching). To achieve data model flexibility, it follows Semantic Web principles ("almost" W3C JSON-LD compatible), but curbed to fit real world constraints.

Features

Tools

See Roadmap for upcoming features.

Team

License : Affero GPL3, except for client libraries which are LGPL3

Getting Started with the server

Requirements : Java JDK 8-11, MongoDB 2.6-4.2

Build (Maven 3 required) : at root, do : mvn clean install

Deployment : go in the ozwillo-datacore-web subproject and do mvn jetty:run

Then go have a look at API documentation and playground at http://localhost:8080/dc-ui/index.html. To try it out, for instance do a GET /dc/type/geo:Area_0 to see what geographical areas (cities...) are available. To learn more about available operations, follow the wiki Playground tutorial and do the city & country Tutorial. To learn about out to use them, have a look at the detailed API doc below.

Alternatively, deploy it on (Tomcat 8 required) : put the war contents in a tomcat 8 root and start it :

cd tomcat8
cp -rf ozwillo-datacore/ozwillo-datacore-web/target/datacore/* webapps/ROOT/
# edit environment and security mode in bin/setenv.sh : export JAVA_OPTS="-Dspring.profiles.active=prod -Ddatacore.securitymode="
# edit configuration in webapps/ROOT/WEB-INF/classes : oasis-datacore-deploy.properties or optional oasis-datacore-deploy-env<env>.properties
./catalina.sh jpda start

In production :

Adding Business Configuration

To use Datacore for your own collaborative data use case, you must define the appropriate business-specific Models.

The preferred way is to use the Datacore online Import tool at http://localhost:8080/dc-ui/import/index.html. Follow the steps described in the wiki Import tutorial.

This can also be done in Java. Do it in a new class on the model of MarkaInvestModel or CityCountrySample (meaning a server-side class, auto initialized by annotating it by @Component, using Spring-injected DataModelServiceImpl and DatacoreApi or DCEntityService, or if they are not enough yet MongoOperations). Sample data for these models can be added using the Datacore REST API obviously, or again using Java in a new class on the model of MarkaInvestData.

For more samples and Model reference documentation, have a look at the wiki.

Using it from a client business application

Use the JSON/HTTP client of your own business application's platform and / or of your choice to call the DatacoreApi server using REST JSON/HTTP calls. Learn about all available operations and their parameters in the API documentation below the playground at http://localhost:8080/dc-ui/index.html, in the dedicated detailed panels such as the one that opens when clicking on http://localhost:8080/dc-ui/index.html#!/dc/findDataInType_get_2.

Here are such clients that might help you :

or jQuery like Citizen Kin did at some time :

$.get(datacoreRestClientBaseurl + "dc/type/sample.citizenkin.user" + "?lastName=" + encodeURIComponent("Smith"), callback))

At worst, you can talk to DatacoreApi server by writing the right JSON/HTTP requests, sending them to it and handling their responses.

Tips for integrating it in a client business application, from a functional point of view

Documentation

See online API (ask URL to Ozwillo or run your own local Datacore) and its packaged examples, wiki and Java tests.

Documentation still can be improved. If something is missing, ask us about it. Especially missing is a more formal description of supported data resources : what field types are supported, how to model them, how they behave (especially Map, List and external vs embedded Resource fields types) ; and wider, documentation of the metamodel itself : field types, Mixin (light, reusable, multiple) types and inheritance, security and mediation configuration...

Administration & development FAQ

How to test Playground handling of historization, encoded uri, post/put, mass delete : create a Resource with a NON-ASCII character in its URI in a historized model such as sample.marka.company in the oasis.samples project (example below), post/ put it a few times, look at historized resources using the H button, click on the slash before the URI id to generate a query that returns several Resources and click on X button :

   {
      "@id": "http://data.ozwillo.com/dc/type/sample.marka.company/Companyé1",
      "@type": [
         "sample.marka.company"
      ],
      "name": "Companyé1",
      "id": 1
   }   

How to test Playground import : import the OpenElec sample, the results should be :

Handled 8 models or mixins in 2 loops   Posted 8 models or mixins (skipped 0, no error)...
...
Handled 17 rows (43 errors) in 0s   Posted 41 resources (skipped 0, no error)...

How to test OAuth2 in development against preprod : in deploy properties change kernel & account URLs and secret (but don't commit it !!), restart, go the Playground page, login using a preprod user, check that the Playground still works (and in HTTP requests for Bearer in the Authorization header, after enabling web development tools)

How to test metrics : in deploy properties uncomment and set datacoreApiServer.metrics.csvReportPeriod=5, start the server, then check that every 5 seconds Codahale Dropwizard metrics are output in CSV ex. to see "number of requests per minute" use (as said at https://github.com/ozwillo/ozwillo-datacore/commit/80131f88de9266bc440f4694b6a40ed1ad690d38 ) :

# in start directory ex. tomcat/bin
tail -f "target/metrics/DatacoreApiImpl_Attribute=Totals.csv" | awk ' { print $14 }' FS=","

MongoDB tips :

List models in a given collection (here the metamodel) :

db["oasis.meta.dcmi:mixin_0"].find().forEach(function(e) { print(e['_p']['dcmo:name'], e['_b']); })

Display (all branch versions of) one model :

db["oasis.meta.dcmi:mixin_0"].find({ "_p.dcmo:name":"org2:Organization_0" })

Upgrade error "Index with name: _uri already exists with different options" : delete the dCEntity dummy collection

db["dCEntity"].drop()

More

See wiki for

Release Notes - 1.0

Release Notes - 0.5

=====================================================

Ozwillo - Datacore http://www.ozwillo.com/ https://github.com/ozwillo/ozwillo-datacore

Copyright (c) 2013-2017 Smile - http://www.smile.fr