Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default out should be Stream<X>, not Optional<Stream<X>> #40

Merged
merged 17 commits into from
Mar 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ name := "angulillos"
organization := "bio4j"
description := "A Java API for typed property graphs with a lot of angulillos"


javaVersion := "1.8"
bucketSuffix := "era7.com"
libraryDependencies += "com.tinkerpop.blueprints" % "blueprints-core" % "2.5.0"
10 changes: 10 additions & 0 deletions docs/src/main/java/com/bio4j/angulillos/Property.java.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public interface Property <
### Index

+ src
+ test
+ java
+ com
+ bio4j
+ angulillos
+ [TwitterGraph.java][test/java/com/bio4j/angulillos/TwitterGraph.java]
+ [TwitterGraphTestSuite.java][test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]
+ resources
+ main
+ java
+ com
Expand All @@ -72,6 +80,8 @@ public interface Property <
+ [TypedEdgeIndex.java][main/java/com/bio4j/angulillos/TypedEdgeIndex.java]
+ [TypedVertex.java][main/java/com/bio4j/angulillos/TypedVertex.java]

[test/java/com/bio4j/angulillos/TwitterGraph.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraph.java.md
[test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java.md
[main/java/com/bio4j/angulillos/TypedGraph.java]: TypedGraph.java.md
[main/java/com/bio4j/angulillos/TypedVertexIndex.java]: TypedVertexIndex.java.md
[main/java/com/bio4j/angulillos/UntypedGraph.java]: UntypedGraph.java.md
Expand Down
222 changes: 143 additions & 79 deletions docs/src/main/java/com/bio4j/angulillos/TypedEdge.java.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,25 +153,25 @@ public interface TypedEdge <
```java
public enum Arity {

oneToOne,
oneToOneOptional,
oneToMany,
oneToManyOptional,

oneOptionalToOne,
oneOptionalToOneOptional,
oneOptionalToMany,
oneOptionalToManyOptional,
fromOneToOne,
fromOneToOptional,
fromOneToMany,
fromOneToManyOptional,

fromOptionalToOne,
fromOptionalToOptional,
fromOptionalToMany,
fromOptionalToManyOptional,

manyToOne,
manyToOneOptional,
manyToMany,
manyToManyOptional,

manyOptionalToOne,
manyOptionalToOneOptional,
manyOptionalToMany,
manyOptionalToManyOptional;
fromManyToOne,
fromManyToOptional,
fromManyToMany,
fromManyToManyOptional,

fromManyOptionalToOne,
fromManyOptionalToOptional,
fromManyOptionalToMany,
fromManyOptionalToManyOptional;
}
```

Expand All @@ -180,129 +180,183 @@ public interface TypedEdge <

We have six basic arities: three for in, three for out.

That an edge type `e` is _always defined_ implies that calling `outV(e)` will always return some, possibly several, vertices

#### in arities

An edge type `e` being _surjective_ implies that calling `inV(e)` will always return some, possibly several, vertices

```java
public interface AlwaysDefined extends HasArity {}
public interface Surjective extends HasArity {}
```

An edge type `e` being _to many_ implies that calling `outV(e)` will in general return more than one vertex
An edge type `e` being _from many_ implies that calling `inV(e)` will in general return more than one vertex

```java
public interface ToMany extends HasArity {}
public interface FromMany extends HasArity {}
```

An edge type `e` being _to one_ implies that calling `outV(e)` will return at most one vertex
An edge type `e` being _from one_ implies that calling `inV(e)` will return at most one vertex

```java
public interface ToOne extends HasArity {}
public interface FromOne extends HasArity {}
```

An edge type `e` is _surjective_ implies that calling `inV(e)` will always return some, possibly several, vertices

#### out arities

That an edge type `e` being _always defined_ implies that calling `outV(e)` will always return some, possibly several, vertices

```java
public interface Surjective extends HasArity {}
public interface AlwaysDefined extends HasArity {}
```

An edge type `e` being _from many_ implies that calling `inV(e)` will in general return more than one vertex
An edge type `e` being _to many_ implies that calling `outV(e)` will in general return more than one vertex

```java
public interface FromMany extends HasArity {}
public interface ToMany extends HasArity {}
```

An edge type `e` being _from one_ implies that calling `inV(e)` will return at most one vertex
An edge type `e` being _to one_ implies that calling `outV(e)` will return at most one vertex

```java
public interface FromOne extends HasArity {}
public interface ToOne extends HasArity {}
```


#### Arity combinations

These are all the possible combinations of the different arities.
These are all the possible combinations of the different arities. In the first line under `extends` you see those that correspond to `in`, and in the second one those that correspond to `out`


```java
public interface OneToOne extends FromOne, AlwaysDefined, ToOne, Surjective {

default Arity arity() { return Arity.oneToOne; }
public interface FromOneToOne
extends
FromOne, Surjective,
ToOne, AlwaysDefined
{
default Arity arity() { return Arity.fromOneToOne; }
}

public interface OneToOneOptional extends FromOne, AlwaysDefined, ToOne {

default Arity arity() { return Arity.oneToOneOptional; }
public interface FromOneToOptional
extends
FromOne, Surjective,
ToOne
{
default Arity arity() { return Arity.fromOneToOptional; }
}

public interface OneToMany extends FromOne, AlwaysDefined, ToMany, Surjective {

default Arity arity() { return Arity.oneToMany; }
public interface FromOneToMany
extends
FromOne, Surjective,
ToMany, AlwaysDefined
{
default Arity arity() { return Arity.fromOneToMany; }
}

public interface OneToManyOptional extends FromOne, AlwaysDefined, ToMany {

default Arity arity() { return Arity.oneToManyOptional; }
public interface FromOneToManyOptional
extends
FromOne, Surjective,
ToMany
{
default Arity arity() { return Arity.fromOneToManyOptional; }
}

public interface OneOptionalToOne extends FromOne, ToOne, Surjective {

default Arity arity() { return Arity.oneOptionalToOne; }
public interface FromOptionalToOne
extends
FromOne,
ToOne, AlwaysDefined
{
default Arity arity() { return Arity.fromOptionalToOne; }
}

public interface OneOptionalToOneOptional extends FromOne, ToOne {

default Arity arity() { return Arity.oneOptionalToOneOptional; }
public interface FromOptionalToOptional
extends
FromOne,
ToOne
{
default Arity arity() { return Arity.fromOptionalToOptional; }
}

public interface OneOptionalToMany extends FromOne, ToMany, Surjective {

default Arity arity() { return Arity.oneOptionalToMany; }
public interface FromOptionalToMany
extends
FromOne,
ToMany, AlwaysDefined
{
default Arity arity() { return Arity.fromOptionalToMany; }
}

public interface OneOptionalToManyOptional extends FromOne, ToMany {

default Arity arity() { return Arity.oneOptionalToManyOptional; }
public interface FromOptionalToManyOptional
extends
FromOne,
ToMany
{
default Arity arity() { return Arity.fromOptionalToManyOptional; }
}


public interface ManyToOne extends FromMany, AlwaysDefined, ToOne, Surjective {

default Arity arity() { return Arity.manyToOne; }
public interface FromManyToOne
extends
FromMany, Surjective,
ToOne, AlwaysDefined
{
default Arity arity() { return Arity.fromManyToOne; }
}

public interface ManyToOneOptional extends FromMany, AlwaysDefined, ToOne {

default Arity arity() { return Arity.manyToOneOptional; }
public interface FromManyToOptional
extends
FromMany, Surjective,
ToOne
{
default Arity arity() { return Arity.fromManyToOptional; }
}

public interface ManyToMany extends FromMany, AlwaysDefined, ToMany, Surjective {

default Arity arity() { return Arity.manyToMany; }
public interface FromManyToMany
extends
FromMany, Surjective,
ToMany, AlwaysDefined
{
default Arity arity() { return Arity.fromManyToMany; }
}

public interface ManyToManyOptional extends FromMany, AlwaysDefined, ToMany {

default Arity arity() { return Arity.manyToManyOptional; }
public interface FromManyToManyOptional
extends
FromMany, Surjective,
ToMany
{
default Arity arity() { return Arity.fromManyToManyOptional; }
}


public interface ManyOptionalToOne extends FromMany, ToOne, Surjective {

default Arity arity() { return Arity.manyOptionalToOne; }
public interface FromManyOptionalToOne
extends
FromMany,
ToOne, AlwaysDefined
{
default Arity arity() { return Arity.fromManyOptionalToOne; }
}

public interface ManyOptionalToOneOptional extends FromMany, ToOne {

default Arity arity() { return Arity.manyOptionalToOneOptional; }
public interface FromManyOptionalToOptional
extends
FromMany,
ToOne
{
default Arity arity() { return Arity.fromManyOptionalToOptional; }
}

public interface ManyOptionalToMany extends FromMany, ToMany, Surjective {

default Arity arity() { return Arity.manyOptionalToMany; }
public interface FromManyOptionalToMany
extends
FromMany,
ToMany, AlwaysDefined
{
default Arity arity() { return Arity.fromManyOptionalToMany; }
}

public interface ManyOptionalToManyOptional extends FromMany, ToMany {

default Arity arity() { return Arity.manyOptionalToManyOptional; }
public interface FromManyOptionalToManyOptional
extends
FromMany,
ToMany
{
default Arity arity() { return Arity.fromManyOptionalToManyOptional; }
}
}
}
Expand All @@ -315,6 +369,14 @@ These are all the possible combinations of the different arities.
### Index

+ src
+ test
+ java
+ com
+ bio4j
+ angulillos
+ [TwitterGraph.java][test/java/com/bio4j/angulillos/TwitterGraph.java]
+ [TwitterGraphTestSuite.java][test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]
+ resources
+ main
+ java
+ com
Expand All @@ -332,6 +394,8 @@ These are all the possible combinations of the different arities.
+ [TypedEdgeIndex.java][main/java/com/bio4j/angulillos/TypedEdgeIndex.java]
+ [TypedVertex.java][main/java/com/bio4j/angulillos/TypedVertex.java]

[test/java/com/bio4j/angulillos/TwitterGraph.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraph.java.md
[test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java.md
[main/java/com/bio4j/angulillos/TypedGraph.java]: TypedGraph.java.md
[main/java/com/bio4j/angulillos/TypedVertexIndex.java]: TypedVertexIndex.java.md
[main/java/com/bio4j/angulillos/UntypedGraph.java]: UntypedGraph.java.md
Expand Down
10 changes: 10 additions & 0 deletions docs/src/main/java/com/bio4j/angulillos/TypedEdgeIndex.java.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ get a list of nodes by providing a value of the indexed property.
### Index

+ src
+ test
+ java
+ com
+ bio4j
+ angulillos
+ [TwitterGraph.java][test/java/com/bio4j/angulillos/TwitterGraph.java]
+ [TwitterGraphTestSuite.java][test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]
+ resources
+ main
+ java
+ com
Expand All @@ -117,6 +125,8 @@ get a list of nodes by providing a value of the indexed property.
+ [TypedEdgeIndex.java][main/java/com/bio4j/angulillos/TypedEdgeIndex.java]
+ [TypedVertex.java][main/java/com/bio4j/angulillos/TypedVertex.java]

[test/java/com/bio4j/angulillos/TwitterGraph.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraph.java.md
[test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java.md
[main/java/com/bio4j/angulillos/TypedGraph.java]: TypedGraph.java.md
[main/java/com/bio4j/angulillos/TypedVertexIndex.java]: TypedVertexIndex.java.md
[main/java/com/bio4j/angulillos/UntypedGraph.java]: UntypedGraph.java.md
Expand Down
10 changes: 10 additions & 0 deletions docs/src/main/java/com/bio4j/angulillos/TypedElement.java.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ public interface TypedElement <
### Index

+ src
+ test
+ java
+ com
+ bio4j
+ angulillos
+ [TwitterGraph.java][test/java/com/bio4j/angulillos/TwitterGraph.java]
+ [TwitterGraphTestSuite.java][test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]
+ resources
+ main
+ java
+ com
Expand All @@ -146,6 +154,8 @@ public interface TypedElement <
+ [TypedEdgeIndex.java][main/java/com/bio4j/angulillos/TypedEdgeIndex.java]
+ [TypedVertex.java][main/java/com/bio4j/angulillos/TypedVertex.java]

[test/java/com/bio4j/angulillos/TwitterGraph.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraph.java.md
[test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java]: ../../../../../test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java.md
[main/java/com/bio4j/angulillos/TypedGraph.java]: TypedGraph.java.md
[main/java/com/bio4j/angulillos/TypedVertexIndex.java]: TypedVertexIndex.java.md
[main/java/com/bio4j/angulillos/UntypedGraph.java]: UntypedGraph.java.md
Expand Down
Loading