ordf

package
v0.0.0-...-c94490f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 GetFieldNameWithTag(structType reflect.Type, tagName string) (fieldName string, tagValue string)

func GetId

func GetId(structure interface{}) string

func RdfDiff

func RdfDiff(old []map[string]rdf.Term, new []map[string]rdf.Term) (remove []map[string]rdf.Term, add []map[string]rdf.Term)

func RdfHash

func RdfHash(triple map[string]rdf.Term) string

func RdfToStruct

func RdfToStruct(result interface{}, id string, triples []map[string]rdf.Term)

func RdfToStructList

func RdfToStructList(result interface{}, triples []map[string]rdf.Term)

func StructToRdf

func StructToRdf(structure interface{}) (id rdf.Term, triples []map[string]rdf.Term, err error)

func StructToRdfWithoutSideEffects

func StructToRdfWithoutSideEffects(structure interface{}) (triples []map[string]rdf.Term, err error)

func TextSearchTriples

func TextSearchTriples(triples []map[string]rdf.Term) (result []map[string]string)

func Turtle

func Turtle(triples []map[string]rdf.Term) (result string)

func TurtleList

func TurtleList(triples []map[string]rdf.Term) (result []string)

func TurtleTriple

func TurtleTriple(triple map[string]rdf.Term) string

Types

type Persistence

type Persistence struct {
	Endpoint  string
	Graph     string
	User      string
	Pw        string
	SparqlLog string
	// contains filtered or unexported fields
}

func (*Persistence) Ask

func (this *Persistence) Ask(query string) (result bool, err error)

func (*Persistence) Connect

func (this *Persistence) Connect() (repo *sparql.Repo, err error)

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 (this *Persistence) CreateListQuery(rdfTypeName string, limit int, offset int) (query string, err error)

func (*Persistence) CreateSearchAllQuery

func (this *Persistence) CreateSearchAllQuery(idSymbol rdf.Term, triple []map[string]rdf.Term) (query string, err error)

func (*Persistence) CreateSearchQuery

func (this *Persistence) CreateSearchQuery(idSymbol rdf.Term, triple []map[string]rdf.Term, limit int, offset int) (query string, err error)

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 (this *Persistence) CreateTextSearchQuery(entityType string, idSymbol rdf.Term, textTriples []map[string]rdf.Term, limit int, offset int) (query string, err error)

func (*Persistence) CreateTextVariantSearchQuery

func (this *Persistence) CreateTextVariantSearchQuery(entityType string, mainSymbol string, textTriples []map[string]rdf.Term, variants map[string][]map[string]rdf.Term, limit int, offset int) (query string, err error)

func (*Persistence) CreateUpdateQuery

func (this *Persistence) CreateUpdateQuery(old interface{}, new interface{}) (query string, err error)

func (*Persistence) CreateVariantSearchAllQuery

func (this *Persistence) CreateVariantSearchAllQuery(mainSymbol string, maintriple []map[string]rdf.Term, variants map[string][]map[string]rdf.Term) (query string, err error)

func (*Persistence) CreateVariantSearchQuery

func (this *Persistence) CreateVariantSearchQuery(mainSymbol string, maintriple []map[string]rdf.Term, variants map[string][]map[string]rdf.Term, limit int, offset int) (query string, err error)

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)

type Symbol

type Symbol struct {
	Id int
}

func (Symbol) Serialize

func (this Symbol) Serialize(rdf.Format) string

func (Symbol) String

func (this Symbol) String() string

func (Symbol) Type

func (this Symbol) Type() rdf.TermType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL