Classes and AttributesBeing object-oriented the Semantic Graph Index data model uses classes. A class can inherit from one or more classes. Use a single inheritance when possible. A class is composed of attributes. Example: class Person {
firstName : String
lastName : String
size : Integer
}
As you can see in this example, attributes are typed. The supported types are:
Default ClassThe default class is class Item {
@RootClass
uri: ItemUri
class: ItemClass
self: Binary
text: FullTextSearch
source: String
stamp: String
}
The most important element in this class is the Reference TypeThe Example: class Company {
name : String
description : Text
}
class Employee : Person {
employeeId : Integer
company : Reference<Company>
}
In this example, the
In our example, it means that from a Standard traversal is faster than reverse traversal, but with this ability to traverse the
In our example, the Structure Attributes (Collection, List, and Map Types)The Data Model supports several "structure" attribute types:
class Factory {
name : String
location : Geo
}
class Company {
name : String
description : Text
factories : Collection<Factory>
}
The Use the class Photo {
filename : String
content : Binary
exif : Map<String>
}
However, you can specify advanced attribute types, like: class Person {
firstName : String
lastName : String
size : Integer
relationships : Map<List<Reference<Person>>>
}
PackagesA class is part of a package. Packages are similar to Java packages, they are used as namespaces. A class is identified by the pair (package name, class name), which means that it is possible to have 2 classes with the same name in 2 different packages. When referencing a class outside of the current package, you must use its full name. class Company {
name : String
description : Text
factories : Collection<manufacturing.Factory>
}
| ||||||||||||