Codota Logo
ATermRenderer
Code IndexAdd Codota to your IDE (free)

How to use
ATermRenderer
in
openllet.core.output

Best Java code snippets using openllet.core.output.ATermRenderer (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: com.github.galigator.openllet/openllet-jena

public NodeFormatter(final Model model)
{
  if (model == null)
    throw new NullPointerException("No model given!");
  //_renderer = new ATermAbstractSyntaxRenderer();
  _renderer = new ATermManchesterSyntaxRenderer();
  _sw = new StringWriter();
  _formatter = new PrintWriter(_sw);
  _renderer.setWriter(_formatter);
  _qnames = JenaUtils.makeQNameProvider(model);
  //        _formatter.setQNames(_qnames);
  if (model instanceof InfModel)
  {
    final InfGraph graph = (InfGraph) model.getGraph();
    _rawModel = ModelFactory.createModelForGraph(graph.getRawGraph());
  }
  else
    _rawModel = model;
}
origin: Galigator/openllet

public String format(final RDFNode node)
{
  if (node == null)
    return "<<null>>";
  //        usedStatements = new HashSet();
  _sw.getBuffer().setLength(0);
  final ATerm term = node2term(node);
  if (term instanceof ATermAppl)
    _renderer.visit((ATermAppl) term);
  else
  {
    _sw.write("{");
    _renderer.visitList((ATermList) term);
    _sw.write("}");
  }
  return _sw.toString();
}
origin: Galigator/openllet

@Test
public void testNot()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  r.visit(not(C));
  final String expected = "not C";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testNot()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  r.visit(not(C));
  final String expected = "not C";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testSelf()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl p = term("p");
  r.visit(self(p));
  final String expected = "(p Self)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-jena

public String format(final RDFNode node)
{
  if (node == null)
    return "<<null>>";
  //        usedStatements = new HashSet();
  _sw.getBuffer().setLength(0);
  final ATerm term = node2term(node);
  if (term instanceof ATermAppl)
    _renderer.visit((ATermAppl) term);
  else
  {
    _sw.write("{");
    _renderer.visitList((ATermList) term);
    _sw.write("}");
  }
  return _sw.toString();
}
origin: Galigator/openllet

public NodeFormatter(final Model model)
{
  if (model == null)
    throw new NullPointerException("No model given!");
  //_renderer = new ATermAbstractSyntaxRenderer();
  _renderer = new ATermManchesterSyntaxRenderer();
  _sw = new StringWriter();
  _formatter = new PrintWriter(_sw);
  _renderer.setWriter(_formatter);
  _qnames = JenaUtils.makeQNameProvider(model);
  //        _formatter.setQNames(_qnames);
  if (model instanceof InfModel)
  {
    final InfGraph graph = (InfGraph) model.getGraph();
    _rawModel = ModelFactory.createModelForGraph(graph.getRawGraph());
  }
  else
    _rawModel = model;
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testInverse()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl p = term("p");
  r.visit(inv(p));
  final String expected = "inverse p";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: Galigator/openllet

public String format(final RDFNode node)
{
  if (node == null)
    return "<<null>>";
  //        usedStatements = new HashSet();
  _sw.getBuffer().setLength(0);
  final ATerm term = node2term(node);
  if (term instanceof ATermAppl)
    _renderer.visit((ATermAppl) term);
  else
  {
    _sw.write("{");
    _renderer.visitList((ATermList) term);
    _sw.write("}");
  }
  return _sw.toString();
}
origin: Galigator/openllet

public NodeFormatter(final Model model)
{
  if (model == null)
    throw new NullPointerException("No model given!");
  //_renderer = new ATermAbstractSyntaxRenderer();
  _renderer = new ATermManchesterSyntaxRenderer();
  _sw = new StringWriter();
  _formatter = new PrintWriter(_sw);
  _renderer.setWriter(_formatter);
  _qnames = JenaUtils.makeQNameProvider(model);
  //        _formatter.setQNames(_qnames);
  if (model instanceof InfModel)
  {
    final InfGraph graph = (InfGraph) model.getGraph();
    _rawModel = ModelFactory.createModelForGraph(graph.getRawGraph());
  }
  else
    _rawModel = model;
}
origin: Galigator/openllet

@Test
public void testInverse()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl p = term("p");
  r.visit(inv(p));
  final String expected = "inverse p";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: Galigator/openllet

@Test
public void testSelf()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl p = term("p");
  r.visit(self(p));
  final String expected = "(p Self)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testMin()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  final ATermAppl p = term("p");
  r.visit(min(p, 3, C));
  final String expected = "(p min 3 C)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: Galigator/openllet

@Test
public void testAll()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  final ATermAppl p = term("p");
  r.visit(all(p, C));
  final String expected = "(p only C)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: Galigator/openllet

@Test
public void testHasValue()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl l = literal("foobar");
  final ATermAppl p = term("p");
  r.visit(hasValue(p, l));
  final String expected = "(p value \"foobar\")";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testHasValue()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl l = literal("foobar");
  final ATermAppl p = term("p");
  r.visit(hasValue(p, l));
  final String expected = "(p value \"foobar\")";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testSome()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  final ATermAppl p = term("p");
  r.visit(some(p, C));
  final String expected = "(p some C)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testAll()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  final ATermAppl p = term("p");
  r.visit(all(p, C));
  final String expected = "(p only C)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: com.github.galigator.openllet/openllet-core

@Test
public void testMax()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  final ATermAppl p = term("p");
  r.visit(max(p, 3, C));
  final String expected = "(p max 3 C)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
origin: Galigator/openllet

@Test
public void testMax()
{
  final StringWriter s = new StringWriter();
  final ATermRenderer r = new ATermManchesterSyntaxRenderer();
  r.setWriter(new PrintWriter(s));
  final ATermAppl C = term("C");
  final ATermAppl p = term("p");
  r.visit(max(p, 3, C));
  final String expected = "(p max 3 C)";
  final String actual = s.toString();
  assertEquals(expected, actual);
}
openllet.core.outputATermRenderer

Javadoc

A special kind of visitor that is designed to render the terms to output. The output is sent to an OutputFormatter so that outputing HTML format is supported.

Most used methods

  • setWriter
  • visit
  • visitList

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • putExtra (Intent)
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now