Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicate as entity support #11

Merged
merged 1 commit into from
Aug 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/operations/create/request/individual-property.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ An object considered as $INDIVIDUAL_PROPERTY is something like:
"id": "ciptr5cuf000f3k6kyos9083o",
"attributes":
{
"type": "$INDIVIDUAL_PROPERTY",
"predicate": "..." -----> ?
"type": "$INDIVIDUAL_PROPERTY"
},
"relations":
{
"subject": "ciptqwkw800043k6kg0qk1j4w",
"predicate": "circhqgcf00003k6poa8w0g0q",
"object": "ciptr4z1f00093k6krpx3vuhe"
}
}
Expand All @@ -37,8 +37,8 @@ module.exports =

getSubjectId: ->
@relations.subject
getPredicate: ->
@attributes.predicate
getPredicateId: ->
@relations.predicate
getObjectId: ->
@relations.object

Expand All @@ -50,5 +50,5 @@ module.exports =
@attributes? and
@relations? and
@relations.subject? and
@attributes.predicate? and
@relations.object?
@relations.predicate? and
@relations.object?
15 changes: 7 additions & 8 deletions src/operations/create/request/predicate.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ module.exports =
constructor: (payload) ->
payload = JSON.parse(payload) if typeof payload is 'string'

try @type = payload.type
try @id = payload.id
try @name = payload.name
try @attributes = payload.attributes
try @relations = payload.relations


addSuper: (@super) ->

isValid: ->

@id? and
@name?


@type? and @type is '$PREDICATE' and
@id? and
@attributes? and
@relations?
8 changes: 4 additions & 4 deletions src/operations/create/request/value-property.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ an object considered as $VALUE_PROPERTY is something like:
"id": "ciptr4z1g000d3k6kiybrvep4",
"attributes":
{
"predicate": "rdfs:label", ---> ?
"object": "Unnamed", -------> ?
"type": "$VALUE_PROPERTY" ---> repeated?
},
"relations":
{
"subject": "ciptr4z1f00093k6krpx3vuhe"
"predicate": "circhqgcf00003k6poa8w0g0q",
}
}

Expand All @@ -37,8 +37,8 @@ module.exports =

getSubjectId: ->
@relations.subject
getPredicate: ->
@attributes.predicate
getPredicateId: ->
@relations.predicate
getValue: ->
@attributes.object
getDatatype: ->
Expand All @@ -53,4 +53,4 @@ module.exports =
@attributes.object? and
@relations? and
@relations.subject? and
@attributes.predicate?
@relations.predicate?