SPARQL builder and CQL-to-SPARQL converter SUP-652
[cql-java-moved-to-github.git] / src / main / java / org / z3950 / zing / cql / sparql / TriplePattern.java
diff --git a/src/main/java/org/z3950/zing/cql/sparql/TriplePattern.java b/src/main/java/org/z3950/zing/cql/sparql/TriplePattern.java
new file mode 100644 (file)
index 0000000..88430b2
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1995-2014, Index Data
+ * All rights reserved.
+ * See the file LICENSE for details.
+ */
+
+package org.z3950.zing.cql.sparql;
+
+import org.z3950.zing.cql.utils.PrettyPrinter;
+
+/**
+ *
+ * @author jakub
+ */
+public class TriplePattern implements GraphPattern {
+  private final String subject;
+  private final String predicate;
+  private final String object;
+
+  public TriplePattern(String subjet, String predicate, String object) {
+    this.subject = subjet;
+    this.predicate = predicate;
+    this.object = object;
+  }
+  
+  @Override
+  public void print(PrettyPrinter wr) {
+    wr.startl(subject).put(" ")
+      .put(predicate).put(" ")
+      .put(object).put(" .").endl();
+  }
+  
+}