Documentation ¶
Index ¶
- Constants
- func GetFieldNameWithTag(structType reflect.Type, tagName string) (fieldName string, tagValue string)
- func GetId(structure interface{}) string
- func RdfDiff(old []map[string]rdf.Term, new []map[string]rdf.Term) (remove []map[string]rdf.Term, add []map[string]rdf.Term)
- func RdfHash(triple map[string]rdf.Term) string
- func RdfToStruct(result interface{}, id string, triples []map[string]rdf.Term)
- func RdfToStructList(result interface{}, triples []map[string]rdf.Term)
- func StructToRdf(structure interface{}) (id rdf.Term, triples []map[string]rdf.Term, err error)
- func StructToRdfWithoutSideEffects(structure interface{}) (triples []map[string]rdf.Term, err error)
- func TextSearchTriples(triples []map[string]rdf.Term) (result []map[string]string)
- func Turtle(triples []map[string]rdf.Term) (result string)
- func TurtleList(triples []map[string]rdf.Term) (result []string)
- func TurtleTriple(triple map[string]rdf.Term) string
- type Persistence
- func (this *Persistence) Ask(query string) (result bool, err error)
- func (this *Persistence) Connect() (repo *sparql.Repo, err error)
- func (this *Persistence) CreateDeleteQuery(structure interface{}) (query string, err error)
- func (this *Persistence) CreateIdExistsQuery(id string) (query string, err error)
- func (this *Persistence) CreateIdIsOfClassQuery(id string, entityType string) (query string, err error)
- func (this *Persistence) CreateInsertQuery(structure interface{}) (query string, err error)
- func (this *Persistence) CreateListQuery(rdfTypeName string, limit int, offset int) (query string, err error)
- func (this *Persistence) CreateSearchAllQuery(idSymbol rdf.Term, triple []map[string]rdf.Term) (query string, err error)
- func (this *Persistence) CreateSearchQuery(idSymbol rdf.Term, triple []map[string]rdf.Term, limit int, offset int) (query string, err error)
- func (this *Persistence) CreateSelectDeepQuery(id string) (query string, err error)
- func (this *Persistence) CreateSelectQuery(id string) (query string, err error)
- func (this *Persistence) CreateTextSearchQuery(entityType string, idSymbol rdf.Term, textTriples []map[string]rdf.Term, ...) (query string, err error)
- func (this *Persistence) CreateTextVariantSearchQuery(entityType string, mainSymbol string, textTriples []map[string]rdf.Term, ...) (query string, err error)
- func (this *Persistence) CreateUpdateQuery(old interface{}, new interface{}) (query string, err error)
- func (this *Persistence) CreateVariantSearchAllQuery(mainSymbol string, maintriple []map[string]rdf.Term, ...) (query string, err error)
- func (this *Persistence) CreateVariantSearchQuery(mainSymbol string, maintriple []map[string]rdf.Term, ...) (query string, err error)
- func (this *Persistence) Delete(structure interface{}) (results []map[string]rdf.Term, err error)
- func (this *Persistence) IdExists(id string) (result bool, err error)
- func (this *Persistence) IdIsOfClass(structure interface{}) (result bool, err error)
- func (this *Persistence) Insert(structure interface{}) (results []map[string]rdf.Term, err error)
- func (this *Persistence) List(structure interface{}, limit int, offset int) (err error)
- func (this *Persistence) Request(query string) (result *sparql.Results, err error)
- func (this *Persistence) Search(resultList interface{}, queryStruct interface{}, limit int, offset int) (err error)
- func (this *Persistence) SearchAll(resultList interface{}, queryStruct interface{}) (err error)
- func (this *Persistence) SearchText(resultList interface{}, queryStruct interface{}, limit int, offset int) (err error)
- func (this *Persistence) Select(structure interface{}) (err error)
- func (this *Persistence) SelectDeep(structure interface{}) (err error)
- func (this *Persistence) SelectLevel(structure interface{}, lvl int) (err error)
- func (this *Persistence) SetId(entity interface{}) (err error)
- func (this *Persistence) SetIdDeep(entity interface{}) (err error)
- func (this *Persistence) Update(old interface{}, new interface{}) (results []map[string]rdf.Term, err error)
- func (this *Persistence) VariationSearch(resultList interface{}, limit int, offset int, mandatory interface{}, ...) (err error)
- func (this *Persistence) VariationSearchAll(resultList interface{}, mandatory interface{}, andOneOf ...interface{}) (err error)
- func (this *Persistence) VariationTextSearch(resultList interface{}, limit int, offset int, queryStruct interface{}, ...) (err error)
- type Symbol
Constants ¶
View Source
const ( RDF_FIELD_TAG_NAME = "rdf_field" //add to field to describe predicateName -> `rdf:"www.example.com/predicateUri"` //add to field to inform that this field describes the id of the entity //informs about the type of the describe entity -> `rdf_entity:"www.example.com/ServiceTypeUri"` RDF_ENTITY_TAG_NAME = "rdf_entity" //add to string or []string field to declare that the value is a id of a entity and not a literal // --> `rdf_ref:"true"` RDF_REF_TAG_NAME = "rdf_ref" //add to id field (field with <<RDF_ENTITY_TAG_NAME>>) to indicate that the structure is a root entity //is needed to prevent the entities deletion on update off a depending entity //effects the result of StructToRdfWithoutSideEffects() but not StructToRdf() // --> `rdf_entity:"http://www.example.com/User" rdf_root:"true"` RDF_ROOT_ENTITY_TAG_NAME = "rdf_root" //similar to root but on the using side RDF_LEND_TAG_NAME = "rdf_lending" RDF_TYPE_PREDICATE_NAME = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" )
View Source
const SPARQL_DEEP = `` /* 304-byte string literal not displayed */
View Source
const SPARQL_DELETE = `
DELETE DATA FROM <{{graph}}>
{
{{{turtle}}}
}
`
View Source
const SPARQL_ID_EXISTS = `
ASK
FROM <{{{graph}}}>
{ <{{{id}}}> a ?t }`
View Source
const SPARQL_ID_IS_OF_CLASS = `
ASK
FROM <{{{graph}}}>
{ <{{{id}}}> a <{{{type}}}> }`
View Source
const SPARQL_INSERT_TURTLE = `
INSERT INTO <{{graph}}>
{
{{{turtle}}}
}
`
View Source
const SPARQL_LIST = `` /* 241-byte string literal not displayed */
View Source
const SPARQL_SEARCH = `` /* 202-byte string literal not displayed */
View Source
const SPARQL_SEARCH_ALL = `` /* 149-byte string literal not displayed */
View Source
const SPARQL_SEARCH_ALL_VARIATION = `` /* 329-byte string literal not displayed */
View Source
const SPARQL_SEARCH_VARIATION = `` /* 379-byte string literal not displayed */
View Source
const SPARQL_SELECT = `
SELECT <{{{id}}}> as ?s ?p ?o
FROM <{{{graph}}}>
WHERE { <{{{id}}}> ?p ?o }`
find by entity id
View Source
const SPARQL_TEXT_SEARCH = `` /* 517-byte string literal not displayed */
View Source
const SPARQL_TEXT_SEARCH_VARIATION = `` /* 668-byte string literal not displayed */
View Source
const SPARQL_UPDATE = `
DELETE DATA FROM <{{graph}}>
{
{{{remove}}}
};
INSERT INTO <{{graph}}>
{
{{{add}}}
}
`
View Source
const TermSymbol = rdf.TermLiteral + 1
Variables ¶
This section is empty.
Functions ¶
func GetFieldNameWithTag ¶
func RdfToStructList ¶
func StructToRdf ¶
func TextSearchTriples ¶
Types ¶
type Persistence ¶
type Persistence struct { Endpoint string Graph string User string Pw string SparqlLog string // contains filtered or unexported fields }
func (*Persistence) CreateDeleteQuery ¶
func (this *Persistence) CreateDeleteQuery(structure interface{}) (query string, err error)
func (*Persistence) CreateIdExistsQuery ¶
func (this *Persistence) CreateIdExistsQuery(id string) (query string, err error)
func (*Persistence) CreateIdIsOfClassQuery ¶
func (this *Persistence) CreateIdIsOfClassQuery(id string, entityType string) (query string, err error)
func (*Persistence) CreateInsertQuery ¶
func (this *Persistence) CreateInsertQuery(structure interface{}) (query string, err error)
func (*Persistence) CreateListQuery ¶
func (*Persistence) CreateSearchAllQuery ¶
func (*Persistence) CreateSearchQuery ¶
func (*Persistence) CreateSelectDeepQuery ¶
func (this *Persistence) CreateSelectDeepQuery(id string) (query string, err error)
func (*Persistence) CreateSelectQuery ¶
func (this *Persistence) CreateSelectQuery(id string) (query string, err error)
func (*Persistence) CreateTextSearchQuery ¶
func (*Persistence) CreateTextVariantSearchQuery ¶
func (*Persistence) CreateUpdateQuery ¶
func (this *Persistence) CreateUpdateQuery(old interface{}, new interface{}) (query string, err error)
func (*Persistence) CreateVariantSearchAllQuery ¶
func (*Persistence) CreateVariantSearchQuery ¶
func (*Persistence) Delete ¶
func (this *Persistence) Delete(structure interface{}) (results []map[string]rdf.Term, err error)
func (*Persistence) IdExists ¶
func (this *Persistence) IdExists(id string) (result bool, err error)
func (*Persistence) IdIsOfClass ¶
func (this *Persistence) IdIsOfClass(structure interface{}) (result bool, err error)
func (*Persistence) Insert ¶
func (this *Persistence) Insert(structure interface{}) (results []map[string]rdf.Term, err error)
func (*Persistence) List ¶
func (this *Persistence) List(structure interface{}, limit int, offset int) (err error)
func (*Persistence) Request ¶
func (this *Persistence) Request(query string) (result *sparql.Results, err error)
func (*Persistence) Search ¶
func (this *Persistence) Search(resultList interface{}, queryStruct interface{}, limit int, offset int) (err error)
func (*Persistence) SearchAll ¶
func (this *Persistence) SearchAll(resultList interface{}, queryStruct interface{}) (err error)
func (*Persistence) SearchText ¶
func (this *Persistence) SearchText(resultList interface{}, queryStruct interface{}, limit int, offset int) (err error)
func (*Persistence) Select ¶
func (this *Persistence) Select(structure interface{}) (err error)
func (*Persistence) SelectDeep ¶
func (this *Persistence) SelectDeep(structure interface{}) (err error)
func (*Persistence) SelectLevel ¶
func (this *Persistence) SelectLevel(structure interface{}, lvl int) (err error)
func (*Persistence) SetId ¶
func (this *Persistence) SetId(entity interface{}) (err error)
func (*Persistence) SetIdDeep ¶
func (this *Persistence) SetIdDeep(entity interface{}) (err error)
func (*Persistence) Update ¶
func (this *Persistence) Update(old interface{}, new interface{}) (results []map[string]rdf.Term, err error)
func (*Persistence) VariationSearch ¶
func (this *Persistence) VariationSearch(resultList interface{}, limit int, offset int, mandatory interface{}, andOneOf ...interface{}) (err error)
func (*Persistence) VariationSearchAll ¶
func (this *Persistence) VariationSearchAll(resultList interface{}, mandatory interface{}, andOneOf ...interface{}) (err error)
func (*Persistence) VariationTextSearch ¶
func (this *Persistence) VariationTextSearch(resultList interface{}, limit int, offset int, queryStruct interface{}, andOneOf ...interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.