Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
91559578
Commit
91559578
authored
8 years ago
by
Hemanth Yamijala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-692 Create abstraction layer for graph databases (jnhagelb via yhemanth)
parent
5e724675
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
979 additions
and
0 deletions
+979
-0
.gitignore
.gitignore
+9
-0
pom.xml
graphdb/api/pom.xml
+50
-0
AtlasEdge.java
...n/java/org/apache/atlas/repository/graphdb/AtlasEdge.java
+60
-0
AtlasEdgeDirection.java
...g/apache/atlas/repository/graphdb/AtlasEdgeDirection.java
+27
-0
AtlasElement.java
...ava/org/apache/atlas/repository/graphdb/AtlasElement.java
+74
-0
AtlasGraph.java
.../java/org/apache/atlas/repository/graphdb/AtlasGraph.java
+251
-0
AtlasGraphManagement.java
...apache/atlas/repository/graphdb/AtlasGraphManagement.java
+98
-0
AtlasGraphQuery.java
.../org/apache/atlas/repository/graphdb/AtlasGraphQuery.java
+71
-0
AtlasIndexQuery.java
.../org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
+59
-0
AtlasSchemaViolationException.java
...las/repository/graphdb/AtlasSchemaViolationException.java
+29
-0
AtlasVertex.java
...java/org/apache/atlas/repository/graphdb/AtlasVertex.java
+81
-0
AtlasVertexQuery.java
...org/apache/atlas/repository/graphdb/AtlasVertexQuery.java
+56
-0
GraphDatabase.java
...va/org/apache/atlas/repository/graphdb/GraphDatabase.java
+45
-0
GremlinVersion.java
...a/org/apache/atlas/repository/graphdb/GremlinVersion.java
+29
-0
pom.xml
graphdb/pom.xml
+38
-0
pom.xml
pom.xml
+1
-0
release-log.txt
release-log.txt
+1
-0
No files found.
.gitignore
View file @
91559578
...
...
@@ -16,6 +16,9 @@
# Maven
target
dependency-reduced-pom.xml
core*.dmp
# IntelliJ
*.iml
...
...
@@ -27,6 +30,7 @@ target
.cache
.classpath
.project
.settings
.externalToolBuilders
maven-eclipse.xml
...
...
@@ -52,3 +56,8 @@ test-output
#hbase package downloaded
distro/hbase/*.tar.gz
.cache-main
# emacs files
*#
*~
This diff is collapsed.
Click to expand it.
graphdb/api/pom.xml
0 → 100644
View file @
91559578
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-graphdb
</artifactId>
<version>
0.7-incubating-SNAPSHOT
</version>
</parent>
<artifactId>
atlas-graphdb-api
</artifactId>
<description>
Apache Atlas Graph Datbase API
</description>
<name>
Apache Atlas Graph Database API
</name>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-typesystem
</artifactId>
</dependency>
<dependency>
<groupId>
org.codehaus.jettison
</groupId>
<artifactId>
jettison
</artifactId>
</dependency>
</dependencies>
</project>
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasEdge.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
/**
* Represent an edge in the graph
*
* @param <V> vertex class used by the graph
* @param <E> edge class used by the graph
*/
public
interface
AtlasEdge
<
V
,
E
>
extends
AtlasElement
{
/**
* Gets the incoming vertex for this edge
* @param in
* @return
*/
AtlasVertex
<
V
,
E
>
getInVertex
();
/**
* Gets the outgoing vertex for this edge
*
* @param in
* @return
*/
AtlasVertex
<
V
,
E
>
getOutVertex
();
/**
* Gets the label associated with this edge.
*
* @return
*/
String
getLabel
();
/**
* Converts the edge to an instance of the underlying implementation class. This
* is syntactic sugar that allows the graph database implementation code to be strongly typed. This
* should not be called in other places.
*
* @return
*/
public
E
getE
();
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasEdgeDirection.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
/**
* Enumeration of edge directions to query for.
*/
public
enum
AtlasEdgeDirection
{
IN
,
OUT
,
BOTH
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasElement.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
import
java.util.Collection
;
import
java.util.Set
;
import
org.codehaus.jettison.json.JSONException
;
import
org.codehaus.jettison.json.JSONObject
;
/**
* Represents a graph element.
*
*/
public
interface
AtlasElement
{
/**
* Gets the id of this element
* @return
*/
Object
getId
();
/**
* Gets the names of the properties associated with this element.
* @return
*/
Collection
<?
extends
String
>
getPropertyKeys
();
/**
* Gets the value of the element property with the given name
*
* @param propertyName
* @return
*/
<
T
>
T
getProperty
(
String
propertyName
);
/**
* Removes a property from the vertex.
*/
void
removeProperty
(
String
propertyName
);
/**
* Sets a single-valued property to the given value.
*
* @param propertyName
* @param value
*/
<
T
>
void
setProperty
(
String
propertyName
,
T
value
);
/**
* Creates a Jettison JSONObject from this Element
*
* @param propertyKeys The property keys at the root of the element to serialize. If null, then all keys are serialized.
*/
JSONObject
toJson
(
Set
<
String
>
propertyKeys
)
throws
JSONException
;
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.List
;
import
java.util.Set
;
import
javax.script.Bindings
;
import
javax.script.ScriptException
;
/**
* Represents a graph
*
* @param <V> vertex implementation class
* @param <E> edge implementation class
*/
public
interface
AtlasGraph
<
V
,
E
>
{
/**
* Adds an edge to the graph
*
* @param outVertex
* @param inVertex
* @param label
* @return
*/
AtlasEdge
<
V
,
E
>
addEdge
(
AtlasVertex
<
V
,
E
>
outVertex
,
AtlasVertex
<
V
,
E
>
inVertex
,
String
label
);
/**
* Adds a vertex to the graph
*
* @return
*/
AtlasVertex
<
V
,
E
>
addVertex
();
/**
* Removes the specified edge from the graph
*
* @param edge
*/
void
removeEdge
(
AtlasEdge
<
V
,
E
>
edge
);
/**
* Removes the specified vertex from the graph.
*
* @param vertex
*/
void
removeVertex
(
AtlasVertex
<
V
,
E
>
vertex
);
/**
* Retrieves the edge with the specified id
* @param edgeId
* @return
*/
AtlasEdge
<
V
,
E
>
getEdge
(
String
edgeId
);
/**
* Gets all the edges in the graph.
* @return
*/
Iterable
<
AtlasEdge
<
V
,
E
>>
getEdges
();
/**
* Gets all the vertices in the graph.
* @return
*/
Iterable
<
AtlasVertex
<
V
,
E
>>
getVertices
();
/**
* Gets the vertex with the specified id
*
* @param vertexId
* @return
*/
AtlasVertex
<
V
,
E
>
getVertex
(
String
vertexId
);
/**
* Gets the names of the indexes on edges
* type.
*
* @param type
* @return
*/
Set
<
String
>
getEdgeIndexKeys
();
/**
* Gets the names of the indexes on vertices.
* type.
*
* @param type
* @return
*/
Set
<
String
>
getVertexIndexKeys
();
/**
* Finds the vertices where the given property key
* has the specified value. For multi-valued properties,
* finds the vertices where the value list contains
* the specified value.
*
* @param key
* @param value
* @return
*/
Iterable
<
AtlasVertex
<
V
,
E
>>
getVertices
(
String
key
,
Object
value
);
/**
* Creates a graph query
* @return
*/
AtlasGraphQuery
<
V
,
E
>
query
();
/**
* Creates an index query
*
* @param indexName index name
* @param queryString the query
*
* @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html">Elastic Search Reference</a> for query syntax
*/
AtlasIndexQuery
<
V
,
E
>
indexQuery
(
String
indexName
,
String
queryString
);
/**
* Gets the management object associated with this graph and opens a transaction
* for changes that are made.
* @return
*/
AtlasGraphManagement
getManagementSystem
();
/**
* Commits changes made to the graph in the current transaction.
*/
void
commit
();
/**
* Rolls back changes made to the graph in the current transaction.
*/
void
rollback
();
/**
* Unloads and releases any resources associated with the graph.
*/
void
shutdown
();
/**
* deletes everything in the graph. For testing only
*/
void
clear
();
/**
* Converts the graph to gson and writes it to the specified stream
*
* @param os
* @throws IOException
*/
void
exportToGson
(
OutputStream
os
)
throws
IOException
;
//the following methods insulate Atlas from the details
//of the interaction with Gremlin
/**
*
* When we construct Gremlin select queries, the information we request
* is grouped by the vertex the information is coming from. Each vertex
* is assigned a column name which uniquely identifies it. The queries
* are specially formatted so that the value associated with each of
* these column names is an array with the various things we need
* about that particular vertex. The query evaluator creates a mapping
* that knows what index each bit of information is stored at within
* this array.
* <p/>
* When we execute a Gremlin query, the exact java objects we get
* back vary depending on whether Gremlin 2 or Gremlin 3 is being used.
* This method takes as input a raw row result that was obtained by
* executing a Gremlin query and extracts the value that was found
* at the given index in the array for the given column name.
* <p/>
* If the value found is a vertex or edge, it is automatically converted
* to an AtlasVertex/AtlasEdge.
*
* @param rowValue the raw row value that was returned by Gremin
* @param colName the column name to use
* @param idx the index of the value within the column to retrieve.
*
*/
Object
getGremlinColumnValue
(
Object
rowValue
,
String
colName
,
int
idx
);
/**
* When Gremlin queries are executed, they return
* Vertex and Edge objects that are specific to the underlying
* graph database. This method provides a way to convert these
* objects back into the AtlasVertex/AtlasEdge objects that
* Atlas requires.
*
* @param rawValue the value that was obtained from Gremlin
* @return either an AtlasEdge, an AtlasVertex, or the original
* value depending on whether the rawValue represents an edge,
* vertex, or something else.
*
*/
Object
convertGremlinValue
(
Object
rawValue
);
/**
* Gremlin 2 and Gremlin 3 represent the results of "path"
* queries differently. This method takes as input the
* path from Gremlin and returns the list of objects in the path.
*
* @param rawValue
* @return
*/
List
<
Object
>
convertPathQueryResultToList
(
Object
rawValue
);
/**
* Gets the version of Gremlin that this graph uses.
*
* @return
*/
GremlinVersion
getSupportedGremlinVersion
();
/**
* Executes a gremlin query, returns an object with the raw
* result.
*
* @param gremlinQuery
* @return
*/
Object
executeGremlinScript
(
String
gremlinQuery
)
throws
ScriptException
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
import
org.apache.atlas.typesystem.types.Multiplicity
;
/**
* Management interface for a graph
*
*/
public
interface
AtlasGraphManagement
{
/**
* Checks whether a property with the given key has been defined in the graph schema.
*
* @param key
* @return
*/
boolean
containsPropertyKey
(
String
key
);
/**
* Creates a mixed Vertex index for the graph
*
* @param index the name of the index to create
* @param backingIndex the name of the backing index to use
*/
void
buildMixedVertexIndex
(
String
index
,
String
backingIndex
);
/**
* Creates a mixed Edge index for the graph
*
* @param index the name of the index to create
* @param backingIndex the name of the backing index to use
*/
void
buildMixedEdgeIndex
(
String
index
,
String
backingIndex
);
/**
* Creates a full text index for the given property
*
* @param indexName the name of the index to create
* @param propertyKey the name of the property
* @param backingIndex the name of the backing index to use
*/
void
createFullTextIndex
(
String
indexName
,
String
propertyKey
,
String
backingIndex
);
/**
* Rolls back the changes that have been made to the management system.
*/
void
rollback
();
/**
* Commits the changes that have been made to the management system.
*/
void
commit
();
/**
* Creates a composite index for the given property.
*
* @param propertyName name of the property being indexed
* @param propertyClass the java class of the property value(s)
* @param multiplicity the multiplicity of the property
* @param isUnique whether the property values must be unique
*/
void
createCompositeIndex
(
String
propertyName
,
Class
propertyClass
,
Multiplicity
multiplicity
,
boolean
isUnique
);
/**
* Creates an index for a property.
*
* @param propertyName name of the property being indexed
* @param vertexIndexName name of the index to create
* @param propertyClass the java class of the property value(s)
* @param multiplicity the multiplicity of the property
*/
void
createBackingIndex
(
String
propertyName
,
String
vertexIndexName
,
Class
propertyClass
,
Multiplicity
multiplicity
);
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphQuery.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
/**
* Represents a query against the graph.
*
* @param <V> vertex class used by the graph
* @param <E> edge class used by the graph
*/
public
interface
AtlasGraphQuery
<
V
,
E
>
{
/**
* Adds a predicate that the returned elements must have the specified
* property and that one of the values of the property must be the
* given value.
*
* @param propertyKey
* @param value
* @return
*/
AtlasGraphQuery
<
V
,
E
>
has
(
String
propertyKey
,
Object
value
);
/**
* Executes the query and returns the matching vertices.
* @return
*/
Iterable
<
AtlasVertex
<
V
,
E
>>
vertices
();
/**
* Executes the query and returns the matching edges.
* @return
*/
Iterable
<
AtlasEdge
<
V
,
E
>>
edges
();
/**
* Adds a predicate that the returned elements must have the specified
* property and that its value matches the criterion specified.
*
* @param propertyKey
* @param value
* @return
*/
AtlasGraphQuery
<
V
,
E
>
has
(
String
propertyKey
,
ComparisionOperator
compMethod
,
Object
value
);
public
static
enum
ComparisionOperator
{
GREATER_THAN_EQUAL
,
EQUAL
,
LESS_THAN_EQUAL
}
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
import
java.util.Iterator
;
/**
* A graph query that runs directly against a particular index.
*
* @param <V> vertex class used by the graph
* @param <E> edge class used by the graph
*/
public
interface
AtlasIndexQuery
<
V
,
E
>
{
/**
* Gets the query results.
*
* @return
*/
Iterator
<
Result
<
V
,
E
>>
vertices
();
/**
* Query result from an index query.
*
* @param <V>
* @param <E>
*/
public
interface
Result
<
V
,
E
>
{
/**
* Gets the vertex for this result
*/
AtlasVertex
<
V
,
E
>
getVertex
();
/**
* Gets the score for this result.
*
*/
double
getScore
();
}
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasSchemaViolationException.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
/**
*
*/
public
class
AtlasSchemaViolationException
extends
RuntimeException
{
public
AtlasSchemaViolationException
(
Throwable
cause
)
{
super
(
cause
);
}
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasVertex.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
import
java.util.Collection
;
/**
* Represents a Vertex
*
* @param <V> vertex class used by the graph
* @param <E> edge class used by the graph
*/
public
interface
AtlasVertex
<
V
,
E
>
extends
AtlasElement
{
/**
* Gets the edges incident to this vertex going the
* specified direction that have the specified edgeLabel. If
* the edgeLabel is null, it is ignored.
*
* @param in
* @return
*/
Iterable
<
AtlasEdge
<
V
,
E
>>
getEdges
(
AtlasEdgeDirection
out
,
String
edgeLabel
);
/**
* Gets the edges associated with this vertex going the
* specified direction.
*
* @param in
* @return
*/
Iterable
<
AtlasEdge
<
V
,
E
>>
getEdges
(
AtlasEdgeDirection
in
);
/**
* Adds a value to a multiplicity many property.
*
* @param propertyName
* @param value
*/
<
T
>
void
addProperty
(
String
propertyName
,
T
value
);
/**
* Gets all of the values of the given property.
* @param propertyName
* @return
*/
<
T
>
Collection
<
T
>
getPropertyValues
(
String
propertyName
);
/**
* Creates a vertex query.
* @return
*/
AtlasVertexQuery
<
V
,
E
>
query
();
/**
* Syntactic sugar to get the vertex as an instance of its
* implementation type. This allows the graph database implementation
* code to be strongly typed.
*
* @return
*/
V
getV
();
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasVertexQuery.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
/**
* A query against a particular vertex.
*
* @param <V> vertex class used by the graph
* @param <E> edge class used by the graph
*/
public
interface
AtlasVertexQuery
<
V
,
E
>
{
/**
* Specifies the edge direction that should be query
*
* @param queryDirection
* @return
*/
AtlasVertexQuery
<
V
,
E
>
direction
(
AtlasEdgeDirection
queryDirection
);
/**
* Returns the vertices that satisfy the query condition.
*
* @return
*/
Iterable
<
AtlasVertex
<
V
,
E
>>
vertices
();
/**
* Returns the incident edges that satisfy the query condition.
* @return
*/
Iterable
<
AtlasEdge
<
V
,
E
>>
edges
();
/**
* Returns the number of elements that match the query.
* @return
*/
long
count
();
}
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/GraphDatabase.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
/**
* Represents a graph database
*
* @param <V> vertex class used by the graph database
* @param <E> edge class used by the graph database
*/
public
interface
GraphDatabase
<
V
,
E
>
{
/**
* Returns whether the graph has been loaded.
* @return
*/
boolean
isGraphLoaded
();
/**
* Gets the graph, loading it if it has not been loaded already
* @return
*/
AtlasGraph
<
V
,
E
>
getGraph
();
/**
* Unloads the graph (used testing)
*/
void
unloadGraph
();
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/GremlinVersion.java
0 → 100644
View file @
91559578
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
repository
.
graphdb
;
/**
* Enumeration of the supported versions of Gremlin
*
*
*/
public
enum
GremlinVersion
{
TWO
,
THREE
}
This diff is collapsed.
Click to expand it.
graphdb/pom.xml
0 → 100644
View file @
91559578
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<artifactId>
apache-atlas
</artifactId>
<groupId>
org.apache.atlas
</groupId>
<version>
0.7-incubating-SNAPSHOT
</version>
</parent>
<artifactId>
atlas-graphdb
</artifactId>
<description>
Apache Atlas Graph Database Projects
</description>
<name>
Apache Atlas Graph Database Projects
</name>
<packaging>
pom
</packaging>
<modules>
<module>
api
</module>
</modules>
</project>
This diff is collapsed.
Click to expand it.
pom.xml
View file @
91559578
...
...
@@ -460,6 +460,7 @@
<module>
server-api
</module>
<module>
notification
</module>
<module>
client
</module>
<module>
graphdb
</module>
<module>
titan
</module>
<module>
repository
</module>
<!-- <module>dashboard</module> -->
...
...
This diff is collapsed.
Click to expand it.
release-log.txt
View file @
91559578
...
...
@@ -20,6 +20,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
ATLAS-692 Create abstraction layer for graph databases (jnhagelb via yhemanth)
ATLAS-689 Migrate Atlas-Storm integration to use Storm 1.0 dependencies. (svimal2106 via yhemanth)
ATLAS-754 InstanceSerialization does not serialize Reference in the values array of Reference.(harishjp via sumasai)
ATLAS-626 Hive temporary table metadata is captured in atlas (sumasai)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment