Skip to content

Commit 0421fd5

Browse files
author
Víctor Rodríguez Doncel
committed
bumped version
1 parent ae5e52c commit 0421fd5

12 files changed

Lines changed: 113 additions & 126 deletions

File tree

jodrlapi/clave.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

jodrlapi/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>oeg.licensius</groupId>
55
<artifactId>jodrlapi</artifactId>
6-
<version>1.0.2</version>
6+
<version>1.0.3</version>
77
<packaging>jar</packaging>
88
<name>Java ODRL API</name>
99
<url>http://licensius.com</url>

jodrlapi/src/main/java/oeg/jodrlapi/JODRLApiSettings.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package oeg.jodrlapi;
22

3-
import java.util.List;
4-
import oeg.jodrlapi.helpers.RDFUtils;
5-
import oeg.jodrlapi.odrlmodel.Action;
6-
73
/**
84
* Despliegue como maven:
95
*

odrlapi/pom.xml

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -85,58 +85,64 @@
8585
<version>1.9.13</version>
8686
</dependency>-->
8787
<!-- https://mvnrepository.com/artifact/org.codehaus.jackson/jackson-mapper-asl -->
88-
<!-- https://mvnrepository.com/artifact/org.topbraid/shacl -->
89-
<dependency>
90-
<groupId>org.topbraid</groupId>
91-
<artifactId>shacl</artifactId>
92-
<version>1.3.2</version>
93-
</dependency>
88+
<!-- https://mvnrepository.com/artifact/org.topbraid/shacl -->
89+
<dependency>
90+
<groupId>org.topbraid</groupId>
91+
<artifactId>shacl</artifactId>
92+
<version>1.3.2</version>
93+
</dependency>
9494

95-
<dependency>
96-
<groupId>org.apache.jena</groupId>
97-
<artifactId>jena-core</artifactId>
98-
<version>3.16.0</version>
99-
<type>jar</type>
100-
</dependency>
101-
<dependency>
102-
<groupId>org.apache.jena</groupId>
103-
<artifactId>jena-arq</artifactId>
104-
<version>3.16.0</version>
105-
</dependency>
95+
<dependency>
96+
<groupId>org.apache.jena</groupId>
97+
<artifactId>jena-core</artifactId>
98+
<version>3.16.0</version>
99+
<type>jar</type>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.apache.jena</groupId>
103+
<artifactId>jena-arq</artifactId>
104+
<version>3.16.0</version>
105+
</dependency>
106106

107107
<dependency>
108108
<groupId>com.github.jsonld-java</groupId>
109109
<artifactId>jsonld-java</artifactId>
110110
<version>0.11.0</version>
111111
</dependency>
112112
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
113-
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
114-
<dependency>
115-
<groupId>com.fasterxml.jackson.core</groupId>
116-
<artifactId>jackson-core</artifactId>
117-
<version>2.11.3</version>
118-
</dependency>
119-
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
120-
<dependency>
121-
<groupId>com.fasterxml.jackson.core</groupId>
122-
<artifactId>jackson-databind</artifactId>
123-
<version>2.11.3</version>
124-
</dependency>
113+
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
114+
<dependency>
115+
<groupId>com.fasterxml.jackson.core</groupId>
116+
<artifactId>jackson-core</artifactId>
117+
<version>2.11.3</version>
118+
</dependency>
119+
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
120+
<dependency>
121+
<groupId>com.fasterxml.jackson.core</groupId>
122+
<artifactId>jackson-databind</artifactId>
123+
<version>2.11.3</version>
124+
</dependency>
125125

126-
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
127-
<dependency>
128-
<groupId>com.fasterxml.jackson.core</groupId>
129-
<artifactId>jackson-annotations</artifactId>
130-
<version>2.11.3</version>
131-
</dependency>
126+
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
127+
<dependency>
128+
<groupId>com.fasterxml.jackson.core</groupId>
129+
<artifactId>jackson-annotations</artifactId>
130+
<version>2.11.3</version>
131+
</dependency>
132132

133+
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
134+
<dependency>
135+
<groupId>commons-codec</groupId>
136+
<artifactId>commons-codec</artifactId>
137+
<version>1.15</version>
138+
</dependency>
133139

134140

135141
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
136142
<dependency>
137143
<groupId>org.apache.httpcomponents</groupId>
138144
<artifactId>httpclient</artifactId>
139-
<version>4.5.3</version>
145+
<version>4.5.13</version>
140146
</dependency>
141147

142148
</dependencies>
@@ -175,16 +181,16 @@
175181
</execution>
176182
</executions>
177183
</plugin>
178-
<!-- <plugin>
184+
<!-- <plugin>
179185
<groupId>com.google.appengine</groupId>
180186
<artifactId>appengine-maven-plugin</artifactId>
181187
<version>1.9.54</version>
182188
</plugin> -->
183-
<plugin>
184-
<groupId>com.google.cloud.tools</groupId>
185-
<artifactId>appengine-maven-plugin</artifactId>
186-
<version>1.3.1</version>
187-
</plugin>
189+
<plugin>
190+
<groupId>com.google.cloud.tools</groupId>
191+
<artifactId>appengine-maven-plugin</artifactId>
192+
<version>1.3.1</version>
193+
</plugin>
188194

189195
</plugins>
190196
</build>

odrlapi/src/main/java/oeg/odrlapi/main/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class Main {
2323
public static void main(String[] args) {
2424
// transformFolder();
2525
normalize(82);
26-
// validate(74);
26+
validate(74);
2727
// superTest();
2828
}
2929

odrlapi/src/main/java/oeg/odrlapi/rdf/ODRLConverter.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@
1414
import java.util.Map;
1515
import java.util.Scanner;
1616
import org.apache.commons.io.FilenameUtils;
17-
import org.apache.jena.rdf.model.Model;
18-
19-
import org.apache.jena.graph.Graph;
2017
import org.apache.jena.query.DatasetFactory;
2118
import org.apache.jena.rdf.model.Model;
2219
import org.apache.jena.riot.JsonLDWriteContext;
2320
import org.apache.jena.riot.RDFDataMgr;
2421
import org.apache.jena.riot.RDFFormat;
25-
import static org.apache.jena.riot.RDFLanguages.JSONLD;
2622
import org.apache.jena.riot.WriterDatasetRIOT;
2723
import org.apache.jena.riot.system.PrefixMap;
2824
import org.apache.jena.riot.system.RiotLib;

odrlapi/src/main/java/oeg/odrlapi/rdf/ODRLParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.apache.jena.rdf.model.Resource;
1111

1212
/**
13-
* Parsing of RDF ODRL Policies.
13+
* Parsing of RDF ODRL Policies for JENA models
1414
* @author vroddon
1515
*/
1616
public class ODRLParser {

odrlapi/src/main/java/oeg/odrlapi/rdf/TestSPARQL.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
import java.io.InputStream;
44
import java.net.URL;
55
import java.util.Scanner;
6-
import org.apache.jena.query.Query;
7-
import org.apache.jena.query.QueryExecution;
8-
import org.apache.jena.query.QueryExecutionFactory;
9-
import org.apache.jena.query.QueryFactory;
106
import org.apache.jena.rdf.model.Model;
117
import org.apache.jena.update.UpdateAction;
128

odrlapi/src/main/java/oeg/odrlapi/rest/client/SampleClient.java

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,19 @@
1010
import oeg.odrlapi.rest.server.resources.ValidatorResponse;
1111
import oeg.odrlapi.validator.ODRLValidator;
1212

13-
1413
/**
1514
* Sample client
1615
*/
1716
public class SampleClient {
1817

19-
2018
public static void main(String[] args) {
21-
validator();
22-
test(); test();
19+
validator();
20+
test();
21+
test();
2322
test();
2423
}
25-
26-
public static void test()
27-
{
24+
25+
public static void test() {
2826
try {
2927
URL url = new URL("http://odrlapi.appspot.com/test");
3028
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
@@ -46,9 +44,8 @@ public static void test()
4644
e.printStackTrace();
4745
}
4846
}
49-
50-
public static void evaluator()
51-
{
47+
48+
public static void evaluator() {
5249

5350
try {
5451
URL url = new URL("http://odrlapi.appspot.com/validator");
@@ -81,47 +78,47 @@ public static void evaluator()
8178
}
8279

8380
}
84-
public static void validator()
85-
{
86-
ODRLValidator validator = new ODRLValidator();
87-
String input = "";
88-
ValidatorResponse vres = validator.validate(input);
89-
System.out.println(vres);
90-
try {
91-
92-
URL url = new URL("http://odrlapi.appspot.com/validator");
93-
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
94-
conn.setDoOutput(true);
95-
conn.setRequestMethod("POST");
96-
//conn.setRequestProperty("Content-Type", "application/json");
97-
98-
OutputStream os = conn.getOutputStream();
99-
os.write(input.getBytes());
100-
os.flush();
101-
102-
if (conn.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
103-
throw new RuntimeException("Failed : HTTP error code : "
104-
+ conn.getResponseCode());
105-
}
106-
107-
BufferedReader br = new BufferedReader(new InputStreamReader(
108-
(conn.getInputStream())));
109-
110-
String output;
111-
System.out.println("Output from Server .... \n");
112-
while ((output = br.readLine()) != null) {
113-
114-
System.out.println(output);
115-
}
116-
conn.disconnect();
117-
} catch (MalformedURLException e) {
118-
119-
e.printStackTrace();
120-
} catch (IOException e) {
121-
122-
e.printStackTrace();
123-
124-
}
125-
126-
}
81+
82+
public static void validator() {
83+
ODRLValidator validator = new ODRLValidator();
84+
String input = "";
85+
ValidatorResponse vres = validator.validate(input);
86+
System.out.println(vres);
87+
try {
88+
89+
URL url = new URL("http://odrlapi.appspot.com/validator");
90+
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
91+
conn.setDoOutput(true);
92+
conn.setRequestMethod("POST");
93+
//conn.setRequestProperty("Content-Type", "application/json");
94+
95+
OutputStream os = conn.getOutputStream();
96+
os.write(input.getBytes());
97+
os.flush();
98+
99+
if (conn.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
100+
throw new RuntimeException("Failed : HTTP error code : "
101+
+ conn.getResponseCode());
102+
}
103+
104+
BufferedReader br = new BufferedReader(new InputStreamReader(
105+
(conn.getInputStream())));
106+
107+
String output;
108+
System.out.println("Output from Server .... \n");
109+
while ((output = br.readLine()) != null) {
110+
111+
System.out.println(output);
112+
}
113+
conn.disconnect();
114+
} catch (MalformedURLException e) {
115+
116+
e.printStackTrace();
117+
} catch (IOException e) {
118+
119+
e.printStackTrace();
120+
121+
}
122+
123+
}
127124
}

odrlapi/src/main/java/oeg/odrlapi/validator/Validation02.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
*/
2020
public class Validation02 implements Validation {
2121

22-
public final static String ODRLONTO = "http://w3c.github.io/poe/vocab/ODRL22.ttl";
22+
23+
// public final static String ODRLONTO = "http://w3c.github.io/poe/vocab/ODRL22.ttl";
24+
public final static String ODRLONTO = "https://www.w3.org/ns/odrl/2/ODRL22.ttl";
2325
private static Model odrlmodel = null;
2426

2527
/**

0 commit comments

Comments
 (0)