Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to 2.3.0-SNAPSHOT in the RM adaptor #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adaptor-rm-webapp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target/

/overlays/
/.settings/
4 changes: 2 additions & 2 deletions adaptor-rm-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<version.lyo.core>2.2.0</version.lyo.core>
<version.lyo.server>2.2.0</version.lyo.server>
<version.lyo.core>2.3.0-SNAPSHOT</version.lyo.core>
<version.lyo.server>2.3.0-SNAPSHOT</version.lyo.server>
</properties>
<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import java.util.Map;
import java.util.Set;


import org.apache.jena.JenaRuntime;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.impl.RDFWriterFImpl;
import org.eclipse.lyo.oslc4j.application.OslcWinkApplication;
import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException;
import org.eclipse.lyo.oslc4j.core.model.AllowedValues;
Expand Down Expand Up @@ -88,7 +90,18 @@ public class Application extends OslcWinkApplication {
RESOURCE_CLASSES.add(ResourceShapeService.class);

// Start of user code Custom Resource Classes
// End of user code

// trigger Jena init
ModelFactory.createDefaultModel();
// force plain XML writer
RDFWriterFImpl.alternative(null);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this now out of date based on:
We will:

  1. Depend on 'apache-jena-libs' instead of the individual artefacts.
  2. Replace calls to 'model.getWriter("RDF/XML")' with the invocation of the RDFDataManager 'RDFDataMgr.write(outputStream, model, RDFFormat.RDFXML_PLAIN);'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacing model.getwriter() in the jena-provider project seems to be the proper way to go. If we want to do that, @berezovskyi is arguing that we should do a proper refactoring of the provider classes in the jena-provider project. Do you have the time/effort to do it?
There are many Jax-RS providers that handle XML/RDF. but from my analysis of these classes, they all end up in the AbstractOslcRdfXmlProvider.java class.

The alternative above is the hack because it is based on private classes of Jena (within an adaptor) that gives you the same result, in the short term, without touching Jena-provider.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I actually did develop a Universal provider but that patch needs more work eclipse/lyo.core#9


//other things that didn't help
JenaRuntime.isRDF11 = false;
// final String abbrevProp = System.getProperty(
// "org.eclipse.lyo.oslc4j.alwaysXMLAbbrevOnlyProviders");

// End of user code

RESOURCE_SHAPE_PATH_TO_RESOURCE_CLASS_MAP.put(OslcConstants.PATH_ALLOWED_VALUES, AllowedValues.class);
RESOURCE_SHAPE_PATH_TO_RESOURCE_CLASS_MAP.put(OslcConstants.PATH_COMPACT, Compact.class);
Expand Down
2 changes: 1 addition & 1 deletion adaptor-testing-webapp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target/

/overlays/
/.settings/