-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that ChangeLog events are serialised to RDF
- Loading branch information
1 parent
b5f7207
commit 69b3f7e
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
core/oslc-trs/src/test/java/org/eclipse/lyo/core/trs/Helper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.eclipse.lyo.core.trs; | ||
|
||
import org.apache.jena.rdf.model.Model; | ||
import org.apache.jena.riot.RDFDataMgr; | ||
import org.apache.jena.riot.RDFFormat; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
|
||
public class Helper { | ||
private static final Logger log = LoggerFactory.getLogger(Helper.class); | ||
|
||
static void printModelTrace(Model model) { | ||
final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
RDFDataMgr.write(baos, model, RDFFormat.TRIG_PRETTY); | ||
log.trace(baos.toString()); // .toString(StandardCharsets.UTF_8) for JDK10+ | ||
} | ||
} |