Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
e41bad51
Commit
e41bad51
authored
Jun 26, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FACET] Corpus ok.
parent
4a70c663
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
25 deletions
+22
-25
Main.hs
src/Gargantext/Core/Types/Main.hs
+3
-2
Node.hs
src/Gargantext/Core/Types/Node.hs
+1
-1
Facet.hs
src/Gargantext/Database/Facet.hs
+18
-22
No files found.
src/Gargantext/Core/Types/Main.hs
View file @
e41bad51
...
...
@@ -70,8 +70,9 @@ corpusTree = NodeT Corpus ( [ leafT Document ]
-- * why NodeUser and not just User ?
-- * is this supposed to hold data ?
data
Parent
=
NodeType
NodeId
data
Classification
=
Favorites
|
MyClassifcation
--
data Classification = Favorites | MyClassifcation
data
Lists
=
StopList
|
MainList
|
MapList
|
GroupList
...
...
@@ -144,7 +145,7 @@ nodeTypes = [ (NodeUser , 1)
-- , (TirankGlobal , 17)
--
---- Node management
--
, (Favorites , 15)
,
(
Favorites
,
15
)
--
]
--
...
...
src/Gargantext/Core/Types/Node.hs
View file @
e41bad51
...
...
@@ -236,7 +236,7 @@ type Corpus = Node HyperdataCorpus
type
Document
=
Node
HyperdataDocument
------------------------------------------------------------------------
data
NodeType
=
NodeUser
|
Project
|
Folder
|
Corpus
|
Annuaire
|
Document
|
UserPage
|
DocumentCopy
data
NodeType
=
NodeUser
|
Project
|
Folder
|
Corpus
|
Annuaire
|
Document
|
UserPage
|
DocumentCopy
|
Favorites
|
Classification
|
Lists
|
Metrics
|
Occurrences
...
...
src/Gargantext/Database/Facet.hs
View file @
e41bad51
...
...
@@ -125,19 +125,19 @@ instance Arbitrary FacetChart where
-----------------------------------------------------------------------
getDocFacet
::
Connection
->
Int
->
Maybe
NodeType
->
Maybe
Offset
->
Maybe
Limit
getDocFacet
::
Connection
->
NodeType
->
Int
->
Maybe
NodeType
->
Maybe
Offset
->
Maybe
Limit
->
IO
[
FacetDoc
]
getDocFacet
conn
parent
Id
nodeType
maybeOffset
maybeLimit
=
runQuery
conn
$
selectDocFacet
parentId
nodeType
maybeOffset
maybeLimit
getDocFacet
conn
parent
Type
parentId
nodeType
maybeOffset
maybeLimit
=
runQuery
conn
$
selectDocFacet
parent
Type
parent
Id
nodeType
maybeOffset
maybeLimit
selectDocFacet
::
ParentId
->
Maybe
NodeType
->
Maybe
Offset
->
Maybe
Limit
selectDocFacet
::
NodeType
->
ParentId
->
Maybe
NodeType
->
Maybe
Offset
->
Maybe
Limit
->
Query
FacetDocRead
selectDocFacet
parentId
maybeNodeType
maybeOffset
maybeLimit
=
limit'
maybeLimit
$
offset'
maybeOffset
$
orderBy
(
asc
facetDoc_created
)
$
selectDocFacet'
parentId
maybeNodeType
selectDocFacet
p
Type
p
arentId
maybeNodeType
maybeOffset
maybeLimit
=
limit'
maybeLimit
$
offset'
maybeOffset
$
orderBy
(
asc
facetDoc_created
)
$
selectDocFacet'
p
Type
p
arentId
maybeNodeType
-- | Left join to the favorites
...
...
@@ -215,25 +215,21 @@ leftJoin3''' = leftJoin3 queryNodeNodeTable queryNodeTable queryNodeTable cond12
=
((
.==
)
(
nId
)
(
nId'
))
-- getDocTest :: Connection -> IO [FacetDoc]
-- getDocTest conn = runQuery conn selectDocFacet
-- | Building the facet
-- selectDocFacet' :: ParentId -> Maybe NodeType -> Query FacetDocRead
selectDocFacet'
::
ParentId
->
Maybe
NodeType
->
Query
FacetDocRead
selectDocFacet'
_
_
=
proc
()
->
do
selectDocFacet'
::
NodeType
->
ParentId
->
Maybe
NodeType
->
Query
FacetDocRead
selectDocFacet'
pt
pId
_
=
proc
()
->
do
(
n1
,(
nn
,
n2
))
<-
leftJoin3'''
-<
()
restrict
-<
(
.&&
)
(
node_parentId
n1
.==
(
toNullable
$
pgInt4
347476
))
(
node_typename
n1
.==
(
pgInt4
4
))
restrict
-<
(
.&&
)
(
node_parentId
n1
.==
(
toNullable
$
pgInt4
pId
))
(
node_typename
n1
.==
(
pgInt4
$
nodeTypeId
Document
))
restrict
-<
(
.||
)
(
node_typename
n2
.==
(
toNullable
$
pgInt4
15
))
restrict
-<
(
.||
)
(
node_typename
n2
.==
(
toNullable
$
pgInt4
$
nodeTypeId
Favorites
))
(
isNull
$
node_typename
n2
)
restrict
-<
(
.||
)
(
node_parentId
n2
.==
(
toNullable
$
pgInt4
347476
))
restrict
-<
(
.||
)
(
node_parentId
n2
.==
(
toNullable
$
pgInt4
$
nodeTypeId
Favorites
))
(
isNull
$
node_parentId
n2
)
let
isFav
=
ifThenElse
(
isNull
$
nodeNode_score
nn
)
(
pgBool
False
)
(
pgBool
True
)
--
returnA
-<
FacetDoc
(
node_id
n1
)
(
node_date
n1
)
(
node_hyperdata
n1
)
(
isFav
)
(
pgInt4
1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment