Skip to content

Commit

Permalink
Fix to issue schemaorg#2234
Browse files Browse the repository at this point in the history
  • Loading branch information
Dataliberate committed Apr 30, 2019
1 parent 3da0d20 commit 88c2206
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 9 additions & 6 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ def GetJsonLdContext(layers='core'):
vocablines = ""
externalines = ""
typins = ""
text = apirdfterm.VTerm.getTerm("schema:Text")
url = apirdfterm.VTerm.getTerm("schema:URL")
date = apirdfterm.VTerm.getTerm("schema:Date")
datetime = apirdfterm.VTerm.getTerm("schema:DateTime")
Expand All @@ -1229,12 +1230,14 @@ def GetJsonLdContext(layers='core'):

type = None

if url in range:
type = "@id"
elif date in range:
type = "Date"
elif datetime in range:
type = "DateTime"
#If Text in range don't output a @type value
if not text in range:
if url in range:
type = "@id"
elif date in range:
type = "Date"
elif datetime in range:
type = "DateTime"

typins = ""
if type:
Expand Down
4 changes: 4 additions & 0 deletions docs/releases.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ <h3>Site Improvements</h3>
Stopped the duplication of references for some types in *-types.csv download files.
</li>

<li id="g2234"><a href="https://github.com/schemaorg/schemaorg/issues/2234">Issue #2234</a>:
Fix to JSON-LD Context file - properties with Text in their range should not have '@type: "@id"' set.
</li>

</ul>

</td>
Expand Down

0 comments on commit 88c2206

Please sign in to comment.