Skip to content

Commit

Permalink
Initial migration to Jena 4.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
  • Loading branch information
berezovskyi committed Dec 23, 2021
1 parent 56edd78 commit ae769d2
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import javax.ws.rs.ext.Providers;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.RDFReader;
import org.apache.jena.rdf.model.RDFWriter;
import org.apache.jena.rdf.model.RDFReaderI;
import org.apache.jena.rdf.model.RDFWriterI;
import org.apache.jena.riot.RDFLanguages;
import org.apache.jena.util.FileUtils;
import org.eclipse.lyo.oslc4j.core.OSLC4JConstants;
Expand Down Expand Up @@ -132,7 +132,7 @@ private void writeObjectsTo(final Object[] objects, final OutputStream outputStr
responseInfo,
objects,
properties);
RDFWriter writer = getRdfWriter(serializationLanguage, model);
RDFWriterI writer = getRdfWriter(serializationLanguage, model);

if (serializationLanguage.equals(FileUtils.langXML) || serializationLanguage.equals(FileUtils.langXMLAbbrev))
{
Expand All @@ -154,8 +154,8 @@ private void writeObjectsTo(final Object[] objects, final OutputStream outputStr
}
}

private RDFWriter getRdfWriter(final String serializationLanguage, final Model model) {
RDFWriter writer;
private RDFWriterI getRdfWriter(final String serializationLanguage, final Model model) {
RDFWriterI writer;
if (serializationLanguage.equals(FileUtils.langXMLAbbrev))
{
writer = new RdfXmlAbbreviatedWriter();
Expand Down Expand Up @@ -269,7 +269,7 @@ private String getSerializationLanguage(final MediaType baseMediaType) {

mediaPairs.add(new AbstractMap.SimpleEntry<>(OslcMediaType.TEXT_XML_TYPE,
RDFLanguages.strLangRDFXML));

for (Map.Entry<MediaType, String> mediaPair : mediaPairs) {
if (baseMediaType.isCompatible(mediaPair.getKey())) {
log.trace("Using '{}' writer for '{}' Accept media type",
Expand All @@ -290,7 +290,7 @@ protected Object[] readFrom(final Class<?> type,
{
final Model model = ModelFactory.createDefaultModel();

RDFReader reader = getRdfReader(mediaType, model);
RDFReaderI reader = getRdfReader(mediaType, model);

try
{
Expand All @@ -313,8 +313,8 @@ protected Object[] readFrom(final Class<?> type,
}
}

private RDFReader getRdfReader(final MediaType mediaType, final Model model) {
RDFReader reader;
private RDFReaderI getRdfReader(final MediaType mediaType, final Model model) {
RDFReaderI reader;
final String language = getSerializationLanguage(mediaType);
if (language.equals(FileUtils.langXMLAbbrev))
{
Expand Down
Loading

0 comments on commit ae769d2

Please sign in to comment.