Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some general clean up.

  • Loading branch information...
commit 576c51e7a43d251b5a7babc6a289fb3cdfa7a1ad 1 parent 1b3481c
@dlongley dlongley authored
Showing with 7 additions and 11 deletions.
  1. +7 −11 js/jsonld.js
View
18 js/jsonld.js
@@ -1966,13 +1966,9 @@ function _toRDF(element, namer, subject, property, graph, callback) {
return;
}
- // element must be an IRI (@values covered above)
+ // element must be an rdf:type IRI (@values covered above)
if(_isString(element)) {
- // property can be null for string subject references in @graph
- if(property === null) {
- return;
- }
- // emit IRI for rdf:type, else plain literal
+ // emit IRI
var statement = {
subject: _clone(subject),
property: _clone(property),
@@ -2836,11 +2832,6 @@ function _rankTerm(ctx, term, value) {
// Note: Value must be an object that is a @value or subject/reference.
if(_isValue(value)) {
- // rank non-string value
- if(!_isString(value['@value'])) {
- return (!hasType && !hasLanguage) ? 2 : 1;
- }
-
// value has a @type
if('@type' in value) {
// @types match
@@ -2850,6 +2841,11 @@ function _rankTerm(ctx, term, value) {
return (!hasType && !hasLanguage) ? 1 : 0;
}
+ // rank non-string value
+ if(!_isString(value['@value'])) {
+ return (!hasType && !hasLanguage) ? 2 : 1;
+ }
+
// value has no @type or @language
if(!('@language' in value)) {
// entry @language is specifically null or no @type, @language, or
Please sign in to comment.
Something went wrong with that request. Please try again.