RDFTensor (version 1.3)

getTensor3m: getting tensor from triples

Description

gets a tensor data structure as a set of frontal slices represented as sparse matrices. The entities as subject has a different id than object and the size of subject and object modes can be different.

Usage

getTensor3m(trp, S = NULL, P = NULL, O = NULL)

Arguments

trp

three columns representing the set of triples (subject, predicate, object). Each row representes one triple.

S

the predifined list of subjects

P

The set of predicates

O

the predifined list of objects

Value

A LIST containing:

X

set of sparse matrices with ones in the position of triples, each sparse matix represents one predicate (relationship)

S

the set of entities in the subject domain

O

the set of entities in the object domain

P

the set of predicates