Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Ferma
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Oleksandr Porunov
Ferma
Commits
7e3b18b4
Unverified
Commit
7e3b18b4
authored
7 years ago
by
Jeffrey Phillips Freeman
Browse files
Options
Downloads
Patches
Plain Diff
docs: updated documentation in preperation for release.
parent
e52986f2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
docs/getting_started.md
+37
-36
37 additions, 36 deletions
docs/getting_started.md
docs/index.md
+1
-0
1 addition, 0 deletions
docs/index.md
with
39 additions
and
37 deletions
README.md
+
1
−
1
View file @
7e3b18b4
...
...
@@ -68,7 +68,7 @@ To include Ferma in your project of choice include the following Maven dependenc
<dependency>
<groupId>
com.syncleus.ferma
</groupId>
<artifactId>
ferma
</artifactId>
<version>
3.
1
.0
</version>
<version>
3.
2
.0
</version>
</dependency>
```
...
...
This diff is collapsed.
Click to expand it.
docs/getting_started.md
+
37
−
36
View file @
7e3b18b4
...
...
@@ -22,7 +22,7 @@ In untyped mode there is no automatic typing. Whatever class is explicitly indic
instantiated when performing queries. Lets start with a simple example domain.
```
java
public
class
Person
extends
VertexFrame
{
public
class
Person
extends
Abstract
VertexFrame
{
public
String
getName
()
{
return
getProperty
(
"name"
);
}
...
...
@@ -36,11 +36,11 @@ public class Person extends VertexFrame {
}
public
Knows
addKnows
(
Person
friend
)
{
return
addEdge
(
"knows"
,
friend
,
Knows
.
class
);
return
add
Framed
Edge
(
"knows"
,
friend
,
Knows
.
class
);
}
}
public
class
Knows
extends
EdgeFrame
{
public
class
Knows
extends
Abstract
EdgeFrame
{
public
void
setYears
(
int
years
)
{
setProperty
(
"years"
,
years
);
}
...
...
@@ -55,10 +55,10 @@ And here is how you interact with the framed elements:
```
java
public
void
testUntyped
()
{
Graph
g
=
new
TinkerGraph
();
Graph
g
raph
=
TinkerGraph
.
open
();
// implies untyped mode
FramedGraph
fg
=
new
DelegatingFramedGraph
(
g
);
FramedGraph
fg
=
new
DelegatingFramedGraph
(
g
raph
);
Person
p1
=
fg
.
addFramedVertex
(
Person
.
class
);
p1
.
setName
(
"Jeff"
);
...
...
@@ -88,25 +88,25 @@ Say we extend the Person class with the Programmer class.
public
class
Programmer
extends
Person
{
}
```
Using simple mode will save the type of Java class the element was created with for use later:
```
java
public
void
testSimpleTyping
()
{
Graph
g
=
new
TinkerGraph
();
Graph
g
raph
=
TinkerGraph
.
open
();
// implies simple mode
FramedGraph
fg
=
new
DelegatingFramedGraph
(
g
,
true
,
false
);
FramedGraph
fg
=
new
DelegatingFramedGraph
(
g
raph
,
true
,
false
);
Person
p1
=
fg
.
addFramedVertex
(
Programmer
.
class
);
p1
.
setName
(
"Jeff"
);
Person
p2
=
fg
.
addFramedVertex
(
Person
.
class
);
p2
.
setName
(
"Julia"
);
Person
jeff
=
fg
.
traverse
((
g
)
->
g
.
V
().
has
(
"name"
,
"Jeff"
)).
next
(
Person
.
class
);
Person
julia
=
fg
.
traverse
((
g
)
->
g
.
V
().
has
(
"name"
,
"Julia"
)).
next
(
Person
.
class
);
Assert
.
assertEquals
(
Programmer
.
class
,
jeff
.
getClass
());
Assert
.
assertEquals
(
Person
.
class
,
julia
.
getClass
());
}
...
...
@@ -123,28 +123,28 @@ power to determine parent-child relationships at run time.
The same example as above done with annotations would look something like this.
```
java
public
abstract
class
Person
extends
VertexFrame
{
public
abstract
class
Person
extends
Abstract
VertexFrame
{
@Property
(
"name"
)
public
abstract
String
getName
();
@Property
(
"name"
)
public
abstract
void
setName
(
String
name
);
@Adjacency
(
"knows"
)
public
abstract
Iterator
<
Person
>
;
getKnowsPeople
();
@Adjacency
(
label
=
"knows"
)
public
abstract
List
<
Person
>
getKnowsPeople
();
@Incidence
(
"knows"
)
public
abstract
Iterator
<
Knows
>
getKnows
();
@Incidence
(
label
=
"knows"
)
public
abstract
List
<
Knows
>
getKnows
();
@Incidence
(
"knows"
)
@Incidence
(
label
=
"knows"
)
public
abstract
Knows
addKnows
(
Person
friend
);
public
List
<
Person
>
getFriendsNamedBill
()
{
return
traverse
(
(
v
)
->
v
.
out
(
"knows"
).
has
(
"name"
,
"bill"
).
toList
(
Person
.
class
);
public
List
<
?
extends
Person
>
getFriendsNamedBill
()
{
return
this
.
traverse
(
input
->
input
.
out
(
"knows"
).
has
(
"name"
,
"bill"
)
)
.
toList
(
Person
.
class
);
}
}
public
abstract
class
Knows
extends
EdgeFrame
{
public
abstract
class
Knows
extends
Abstract
EdgeFrame
{
@Property
(
"years"
)
public
abstract
void
setYears
(
int
years
);
...
...
@@ -155,7 +155,7 @@ public abstract class Knows extends EdgeFrame {
public
abstract
Person
getIn
();
@OutVertex
public
abstract
Person
get
In
();
public
abstract
Person
get
Out
();
}
public
abstract
class
Programmer
extends
Person
{
...
...
@@ -169,24 +169,25 @@ construct the byte code for any abstract annotated methods.
```
java
public
void
testAnnotatedTyping
()
{
Set
<
Class
<?>>
types
=
new
HashSet
<
Class
<?>>(
Arrays
.
asList
(
new
Class
<?>[]{
Person
.
class
,
Programmer
.
class
,
Knows
.
class
}));
Graph
g
=
new
TinkerGraph
();
Person
.
class
,
Programmer
.
class
,
Knows
.
class
}));
Graph
g
raph
=
TinkerGraph
.
open
();
//implies annotated mode
FramedGraph
fg
=
new
DelegatingFramedGraph
(
g
,
true
,
types
);
FramedGraph
fg
=
new
DelegatingFramedGraph
(
g
raph
,
true
,
types
);
Person
p1
=
fg
.
addFramedVertex
(
Programmer
.
class
);
p1
.
setName
(
"Jeff"
);
Person
jeff
=
fg
.
addFramedVertex
(
Programmer
.
class
);
jeff
.
setName
(
"Jeff"
);
Person
p2
=
fg
.
addFramedVertex
(
Person
.
class
);
p2
.
setName
(
"Julia"
);
Person
julia
=
fg
.
addFramedVertex
(
Person
.
class
);
julia
.
setName
(
"Julia"
);
julia
.
addKnows
(
jeff
);
Person
j
eff
=
fg
.
traverse
((
g
)
->
g
.
V
().
has
(
"name"
,
"J
eff
"
)).
next
(
Person
.
class
);
Person
j
ulia
=
fg
.
traverse
((
g
)
->
g
.
V
().
has
(
"name"
,
"Julia"
)).
next
(
Person
.
class
);
Person
j
uliaAgain
=
fg
.
traverse
((
g
)
->
g
.
V
().
has
(
"name"
,
"J
ulia
"
)).
next
(
Person
.
class
);
Person
j
effAgain
=
juliaAgain
.
getKnowsPeople
().
get
(
0
);
Assert
.
assert
Equals
(
Programmer
.
class
,
jeff
.
getClass
());
Assert
.
assert
Equals
(
Person
.
class
,
julia
.
getClass
());
Assert
.
assert
True
(
Programmer
.
class
.
isAssignableFrom
(
jeffAgain
.
getClass
())
)
;
Assert
.
assert
True
(
Person
.
class
.
isAssignableFrom
(
juliaAgain
.
getClass
())
)
;
}
```
This diff is collapsed.
Click to expand it.
docs/index.md
+
1
−
0
View file @
7e3b18b4
...
...
@@ -62,6 +62,7 @@ including the following.
Ferma Javadocs:
[
latest
](
http://www.javadoc.io/doc/com.syncleus.ferma/ferma
)
-
[
3.2.0
](
http://www.javadoc.io/doc/com.syncleus.ferma/ferma/3.2.0
)
-
[
3.1.0
](
http://www.javadoc.io/doc/com.syncleus.ferma/ferma/3.1.0
)
-
[
3.0.3
](
http://www.javadoc.io/doc/com.syncleus.ferma/ferma/3.0.3
)
-
[
3.0.2
](
http://www.javadoc.io/doc/com.syncleus.ferma/ferma/3.0.2
)
-
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment