You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astrea can be used as a java library for third-party java projects. First install Astrea as a dependency following the steps detailed in the section **1.1.1 Install Astrea**. Then, in you code create an instance of our Astrea object as follows:
5
-
````
6
-
ShaclFromOwl sharper = new OptimisedOwlGenerator();
7
-
````
8
-
Having this object the shapes, which will be provided as [jena]([https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html](https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html)) Models, can be generated using different methods:
9
-
10
-
- Using the URL of an ontology
11
-
````
12
-
Model shapes = sharper.fromURL("http://iot.linkeddata.es/def/core/ontology.ttl");
13
-
````
14
-
- Using a list containing the URLs of several ontologies
- Using an ontology in memory, consider that the [formats supported are the ones specified in jena]([https://jena.apache.org/documentation/io/](https://jena.apache.org/documentation/io/))
22
-
`````
23
-
Model shapes = sharper.fromOwl(String owlContent, String format);
24
-
`````
25
-
- Using an jena model
26
-
`````
27
-
Model ontologyModel = ModelFactory.createDefaultModel();
28
-
// insert content in the variable ontologyModel
29
-
Model shapes = sharper.fromModel(ontologyModel);
30
-
`````
31
3
32
-
**Keep in mind that Astrea will automatically include all the ontologies that are specified under the owl:imports statement, and therefore, it will generate their shapes as well.**
33
-
34
-
### 1.1 Install Astrea
4
+
## 1 - Install Astrea
35
5
In order to use the Astrea as java library for third-party components there are two approaches: import the library as a *jar* or install Astrea as a local maven dependency and then use your *pom.xml* to import it. Following we provide a guide for both options.
36
6
37
-
#### 1.1.1 Import Astrea as a jar
7
+
#### 1.1Import Astrea as a jar
38
8
Download the last release from our GitHub. Then, import the *jar* file in a project .
39
-
#### 1.1.2 Instaling as local maven dependency
9
+
#### 1.2 Instaling as local maven dependency
40
10
Astrea can be installed as a local dependency. For this purpose download the code from this repository:
3. Import the dependency in your project using the pom file relying on the previous snipped
35
+
3. Import the dependency in your project using the pom file relying on the previous snipped
36
+
37
+
## 2 - Quick start
38
+
Astrea can be used as a java library for third-party java projects, in you code create an instance of our Astrea object as follows:
39
+
````
40
+
ShaclFromOwl sharper = new OwlGenerator();
41
+
````
42
+
Having this object the shapes, which will be provided as [jena]([https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html](https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html)) Models, can be generated using different methods:
43
+
44
+
- Using the URL of an ontology
45
+
````
46
+
Model shapes = sharper.fromURL("http://iot.linkeddata.es/def/core/ontology.ttl");
47
+
````
48
+
- Using a list containing the URLs of several ontologies
- Using an ontology in memory, consider that the [formats supported are the ones specified in jena]([https://jena.apache.org/documentation/io/](https://jena.apache.org/documentation/io/))
56
+
`````
57
+
Model shapes = sharper.fromOwl(String owlContent, String format);
58
+
`````
59
+
- Using an jena model
60
+
`````
61
+
Model ontologyModel = ModelFactory.createDefaultModel();
62
+
// insert content in the variable ontologyModel
63
+
Model shapes = sharper.fromModel(ontologyModel);
64
+
`````
65
+
66
+
**Keep in mind that Astrea will automatically include all the ontologies that are specified under the owl:imports statement, and therefore, it will generate their shapes as well.**
67
+
68
+
**To check other constructors of the OwlGenerator class read our [java doc]()**
<li><ahref="astrea/generators/OptimisedOwlGenerator.html" title="class in astrea.generators" target="classFrame">OptimisedOwlGenerator</a></li>
16
+
<li><ahref="astrea/generators/OwlGenerator.html" title="class in astrea.generators" target="classFrame">OwlGenerator</a></li>
17
+
<li><ahref="astrea/model/ShaclFromOwl.html" title="interface in astrea.model" target="classFrame"><spanclass="interfaceName">ShaclFromOwl</span></a></li>
0 commit comments