|
31 | 31 | import com.marklogic.client.semantics.Capability; |
32 | 32 |
|
33 | 33 | /** |
34 | | - * <p>A manager for CRUD operations on semantic graphs which reside in MarkLogic Server.</p> |
| 34 | + * <p>A manager for CRUD operations on semantic graphs which reside in |
| 35 | + * MarkLogic Server.</p> |
35 | 36 | * |
36 | 37 | * <p>For example:</p> |
37 | 38 | * |
|
44 | 45 | * like so:</p> |
45 | 46 | * |
46 | 47 | * <pre> GraphManager graphMgr = databaseClient.newGraphManager(); |
47 | | - * FileHandle fileHandle = new FileHandle(new File("example.ttl")).withMimetype(RDFMimeTypes.TURTLE); |
| 48 | + * FileHandle fileHandle = new FileHandle(new File("example.ttl")).withMimetype(RDFMimeTypes.NTRIPLES); |
48 | 49 | * graphMgr.write("myExample/graphUri", fileHandle); |
49 | 50 | * </pre> |
50 | 51 | * |
51 | 52 | * <p>Then you could add another triple to the graph like so:</p> |
52 | 53 | * |
53 | 54 | * <pre> StringHandle stringHandle = new StringHandle() |
54 | 55 | * .with("<http://example.org/subject2> <http://example.org/predicate2> <http://example.org/object2> .") |
55 | | - * .withMimetype(RDFMimeTypes.TURTLE); |
| 56 | + * .withMimetype(RDFMimeTypes.NTRIPLES); |
56 | 57 | * graphMgr.merge("myExample/graphUri", stringHandle); |
57 | 58 | * </pre> |
58 | 59 | * |
59 | 60 | * <p>Then you read the graph from the database into turtle syntax into a |
60 | 61 | * variable "triples" like so:</p> |
61 | 62 | * |
62 | 63 | * <pre> String triples = graphMgr.read("myExample/graphUri", |
63 | | - * new StringHandle().withMimetype(RDFMimeTypes.TURTLE).get()); |
| 64 | + * new StringHandle().withMimetype(RDFMimeTypes.NTRIPLES)).get(); |
64 | 65 | * </pre> |
65 | 66 | * |
66 | | - * <p>You could simplify these examples if you first set the default mimetype so you don't have to call setMimetype on each handle. That also enables you to use the *As convenience methods:</p> |
| 67 | + * <p>You could simplify these examples if you first set the default mimetype |
| 68 | + * so you don't have to call setMimetype on each handle. That also enables you |
| 69 | + * to use the *As convenience methods:</p> |
67 | 70 | * |
68 | | - * <pre> graphMgr.setDefaultMimetype(RDFMimeTypes.TURTLE); |
| 71 | + * <pre> graphMgr.setDefaultMimetype(RDFMimeTypes.NTRIPLES); |
69 | 72 | * String triples = graphMgr.readAs("myExample/graphUri", String.class); |
70 | 73 | * </pre> |
71 | 74 | * |
72 | 75 | * <p>If you need to limit access to a graph you can set the permissions:</p> |
73 | 76 | * |
74 | 77 | * <pre> graphMgr.writePermissions("myExample/graphUri", |
75 | 78 | * graphMgr.permission("example_manager", Capability.READ) |
76 | | - * .permission("example_manager", Capability.WRITE)); |
| 79 | + * .permission("example_manager", Capability.UPDATE)); |
77 | 80 | * </pre> |
78 | 81 | * |
79 | 82 | * <p>Permissions can also be added with {@link #mergePermissions |
@@ -110,7 +113,7 @@ public interface GraphManager { |
110 | 113 | * <p>Example:</p> |
111 | 114 | * <pre> StringHandle stringHandle = new StringHandle() |
112 | 115 | * .with("<http://example.org/subject2> <http://example.org/predicate2> <http://example.org/object2> .") |
113 | | - * .withMimetype(RDFMimeTypes.TURTLE); |
| 116 | + * .withMimetype(RDFMimeTypes.NTRIPLES); |
114 | 117 | * graphMgr.merge(DEFAULT_GRAPH, stringHandle);</pre> |
115 | 118 | */ |
116 | 119 | public static String DEFAULT_GRAPH = "com.marklogic.client.semantics.GraphManager.DEFAULT_GRAPH"; |
|
0 commit comments