Skip to content

Commit

Permalink
Re-enable lyo-validation
Browse files Browse the repository at this point in the history
- SHalcEX 0.1.102 is now on Maven Central
- Needed to update Jena to 3.16 due to SHalcEX
  • Loading branch information
berezovskyi committed Jun 19, 2021
1 parent 4ee62bd commit b1ab759
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 33 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

### Changed

- Update SHACLEX from 0.0.87 to 0.1.93 (breaking change but should not affect the consumers of Lyo Validation)
- Update SHaclEX from 0.0.87 to 0.1.102 (mainly due to Bintray shutdown; breaking change but should not affect the consumers of Lyo Validation).
- SHaclEX 0.1.102 depends on Jena 3.16, which requires us to upgrade.
- Update Kotlin from 1.4.20 to 1.5.10
- Lyo Validation returns more messages in the reports. _Make sure your code logic scans all messages the report if you are looking for a specific error._
- Update Eclipse Paho from 1.2.1 to 1.2.5 due to a potential security vulnerability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,11 @@ public static Model createJenaModel(final Object[] objects)
null);
}

static Model createJenaModel(final String descriptionAbout,
final String responseInfoAbout,
final ResponseInfo<?> responseInfo,
final Object[] objects,
final Map<String, Object> properties)
throws DatatypeConfigurationException,
IllegalAccessException,
IllegalArgumentException,
InvocationTargetException,
OslcCoreApplicationException
{
final Model model = ModelFactory.createDefaultModel();
static Model createJenaModel(final String descriptionAbout, final String responseInfoAbout,
final ResponseInfo<?> responseInfo, final Object[] objects, final Map<String, Object> properties)
throws DatatypeConfigurationException, IllegalAccessException, IllegalArgumentException,
InvocationTargetException, OslcCoreApplicationException {
final Model model = ModelFactory.createDefaultModel();

Resource descriptionResource = null;

Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<v.kotlin>1.5.10</v.kotlin>
<v.dokka>1.4.32</v.dokka>

<v.jena>3.14.0</v.jena>
<v.jena>3.16.0</v.jena>
<v.jersey>2.25.1</v.jersey>
<v.slf4j>1.7.30</v.slf4j>
<v.servlet>3.1.0</v.servlet>
Expand Down Expand Up @@ -84,7 +84,7 @@
<module>store</module>
<!-- Remove util https://bugs.eclipse.org/bugs/show_bug.cgi?id=574043
and/or https://github.com/weso/shaclex/issues/390 are resolved-->
<!-- <module>validation</module>-->
<module>validation</module>
</modules>

<profiles>
Expand Down Expand Up @@ -349,12 +349,12 @@
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<!--es.weso:shaclex_2.12:pom:0.0.87-->
<!--es.weso:shaclex_2.12:pom:0.0.87-->
<!-- <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
</dependency> -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<maven.compiler.target>1.8</maven.compiler.target>

<v.jetty>9.4.0.v20161208</v.jetty>
<v.shaclex>0.1.93</v.shaclex>
<v.shaclex>0.1.102</v.shaclex>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Contributors to the Eclipse Foundation
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -24,19 +24,9 @@

import javax.xml.datatype.DatatypeConfigurationException;

import cats.effect.IO;
import cats.effect.IO$;
import cats.effect.kernel.Resource;
import cats.effect.kernel.Resource$;
import cats.effect.unsafe.IORuntime;
import cats.effect.unsafe.IORuntime$;
import es.weso.rdf.RDFBuilder;
import es.weso.rdf.jena.RDFAsJenaModel$;
import es.weso.schema.RDFReport;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.riot.RDFLanguages;
import org.checkerframework.checker.units.qual.A;
import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException;
import org.eclipse.lyo.oslc4j.core.model.AbstractResource;
import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper;
Expand All @@ -47,15 +37,18 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cats.effect.IO;
import cats.effect.unsafe.IORuntime;
import cats.effect.unsafe.IORuntime$;
import es.weso.rdf.PrefixMap;
import es.weso.rdf.RDFReader;
import es.weso.rdf.RDFBuilder;
import es.weso.rdf.jena.RDFAsJenaModel;
import es.weso.schema.RDFReport;
import es.weso.schema.Result;
import es.weso.schema.Schema;
import es.weso.schema.Schemas;
import scala.Option;
import scala.collection.immutable.HashMap;
import scala.util.Either;

/**
* @since 2.3.0
Expand Down Expand Up @@ -146,7 +139,8 @@ private Result validateInternal(Model resourceAsModel, Model shapeAsModel) throw
private Result validate(final RDFAsJenaModel rdf, final Schema schema) {
PrefixMap nodeMap = rdf.getPrefixMap().unsafeRunSync(IO_RUNTIME);
PrefixMap shapesMap = schema.pm();
return schema.validate(rdf, TRIGGER_MODE_TARGET_DECLS, EMPTY_MAP, OPTION_NONE, OPTION_NONE, nodeMap, shapesMap, rdf)
final Option<RDFBuilder> rdfOption = Option.apply(rdf);
return schema.validate(rdf, TRIGGER_MODE_TARGET_DECLS, EMPTY_MAP, OPTION_NONE, OPTION_NONE, nodeMap, shapesMap, rdfOption)
.unsafeRunSync(IO_RUNTIME);
}

Expand Down

0 comments on commit b1ab759

Please sign in to comment.