Overview# Dydra is an excellent cloud-based RDF triple store, but in some cases its JSON-LD serialization may produce output that differs from expectations. This blog post explains the observed behavior and the workaround we implemented.
Observed Behavior# Expected Output# In the JSON-LD specification, URI references are commonly output in object form as follows:
{ } " " " } " } @ @ p , p i t r " r " d y o @ o @ " p v i v i : e : d : d " w " w " " : a : a : h s s t [ A " G " t " t h e h p p t t n t s r r t e t : i p r p b s a s / : u : t : e E t / e / x n e / d / a t d s B s m i T e y e p t o p " p l y " o : o e " : l l . ] i { i c , { a a o . . m e e / t t i h h t e e e r r m s s / c c 1 a a " n n , . . i i o o / / a t d x d / r 0 e x s a s b / c 0 d x . 1 . 2 . 3 " 4 . . . " Output Observed in Dydra# In Dydra’s JSON-LD endpoint, some URI references were observed to be output as plain strings:
{ } " " " " @ @ p p i t r r d y o o " p v v : e : : " w w " : a a h s s t [ A G t " t e p p t n s r r e : i r b a / : u t e E t e x n e d a t d B m i T y p t o " l y " : e " : . ] " c , " h o h t m t t / t p i p s t s : e : m / s 1 s e " e p , p o o l l i i a a . . e e t t h h e e r r s s c c a a n n . . i i o o t a x d / d 0 r x e a s b s c / d 0 . x . 1 . 2 " 3 4 . . . " , Note : This behavior does not occur for all properties and may vary depending on the @context definition and property types.
Impact of Behavioral Differences# Format JSON-LD Parser Interpretation { "@id": "..." }URI reference (link to another node) "..."Literal string
This difference can cause the following impacts:
Affects graph structure traversal Affects some SPARQL query results Affects JSON-LD framing processing Regarding Typed Literals# Similarly, type information may be omitted for typed literals such as xsd:dateTime.
Expected output :
{ } " } p r " " o @ @ v v t : a y s l p t u e a e " r " : t : e " d " x A 2 s t 0 d T 2 : i 5 d m - a e 0 t " 1 e : - T 1 i { 5 m T e 1 " 0 : 3 0 : 0 0 Z " ,
Observed output :
{ } " p r o v : s t a r t e d A t T i m e " : " 2 0 2 5 - 0 1 - 1 5 T 1 0 : 3 0 : 0 0 Z "
Workaround# Since Dydra serializes Turtle (TTL) format accurately, the following strategy was adopted:
[ [ [ [ [ C D n J A l y 3 S p i d O p e r P N l n a a - i t A R r C L C c ] c S e s o D o a c P t e n r t e A u r v C r i p R r ] e o e o t Q n r n c n : L s t s t ] s t t E i r J e n n t u S x d o c O t p T t N / o T Q i - t i L u o L u n a n D r t f d t ] o s L l r o e m g a i t c ] Implementation# i f } m u p n c c c f } c f } r } o P W c o o o o o o e ; r a o t n n n r c i } c c i } l i } } } } p n r c f } g t " " t r r i s s G s o f o o f e f r B s o o r u @ @ s k o t t r t ( n s n n p t e c i } } } e o e o e u t ( n r i } } a r c g { e a n o c s ( u s s ( r B ( b l o f l b l b d i c s f p n o r r p q u s o t ! b t t ! e u o q j s n e e s j s j i l g o t ( n } e n h n a P T o t a u p u n s j p d i b u U e e s ( b l b l b e e e e c d r n c ( o ) l o . { t p a T u u r a b s s u e p p r i l j a R c t l j s j s j c c a a s n o p d i } r ; s d p e h r L n r s d t j t u b c r r e c d e d I t i i L e e T e e P e i t { t t J p t o n r S e f e e E e u x " s d t e s r e b j t e e d a c . V f l t a c y c l c f V V e S h d s e p [ r t x [ s t : e a l r i c q j e s d d i t o t o r a i e n t i p t { a t a a s O : [ e t d e " ( e u { t p h " r n f e = p t u e c . i i c e b V b e l ( t r g V f e V i V ( l l . N s : i c @ t t r r r ( : g d o T = l s a c t s c c a s j a j f u q e a u a d a n a q u u g - A u [ c i t y u n a e n r } r o p e d t s e a a t . e l e e e u r l a l ( l l u e e e L r b R p a a y p r c d o J a c J n a s = I . t t t e s c u c r a a . g u l l l u l u a t D r j e r t l p e n o t i d S p f o D s e r o d h ( e e s e t e t e = d l l e e i i i e i e d = = ( a e c e e e o ; c e O h r n y o w s b n f a s s I . t : . n . a - t t t t . p @ y c o d I h " f f a ) N , o v d n e y e = s u d h ( v t c { o = n t = e e e = e = o { q r g < t r i d a ] r t ; L m e r L P r w q ( b = a p a u e e b g a r r r r b u e r R I d c n o e D r a d a . s u q s j = s r l n r : " j q u g { a a a { a l j " a d a e d < a = d = a m I _ " t ' ( r p u M a u u e s ( e u k m @ e u a g l l l l i e @ d i p c , s t = l = s d C n s t s a b a d a b c u q p d e n T { i c a g e " . . " t c i . c h o t e = i o = a ] O 3 t u e r j p s d j t b u r i s o y d t d e d @ d d @ e t d o a r p r I n b = { r N " o J r r s e < ) . e I j a e c w p " " . . ) v a a o v r . " b t d r i d " g j r = T ; S t ( e c s s c d e d d a w n e @ : t o l a t t t a a t : j e < e n , h e " " a E J O l ) ( t t { u t , c . i t i ; i e b { i l a a h l l e e I s d g t f c o @ y o X S N e ; t r b I t p c e t = d q r j t u t t e u . r ` c d t i , o t o t b i b T O - : u i j d n s r a I h = " u m e e e y y r e v m _ t ) r c b p r s j d f j , N L r n e ) e . e t d = : a T c r " p p " a T : . ! i a u j : . e " o e - D s t g c ) w g d e , t d y t a : e e t : l y $ v . n t n e / @ m c : r c L t l , t e i I y " " . p ; l . h u p { a p g e k c / t a t t D s r e . { M t c d [ p N . o e l & v a l e e q l u , s n t w y p " s s s e i ) M v a ( a ) ] e a . b i & a n i ; u u s ] o s w p ( t i . r n ; a a p s t ) ) m . j = t l t = a e h u w ] w e ( & r n l i g p l ( u e ; i e " e = e u x e = d ; ( n o n . o & i g e a ) < u ) b . { n d c = r e s r = . o k f > o w ) n l n l : s e ) j v f N } t a d a o b n f 3 g e g i t ; ; e a o o . " l ! : l " b j o s = . = t z R r c l r d v L . = s . B j e w u p o > ! } v h a D i t u m e a i v = t v l e c n b { r r = ) a t F n I e a " l t a r a a c t > j e g { = [ l = i G g d ; t ) T u e l " i l n t V > e " d / " u = o r , ) i h e r u h n u k . a c @ i 1 n @ e = n a ! o { i a e t g e N v l = t i c 9 u i s p u ; n s } l , t ) , o a u s d a 9 l d 1 b h n ; " p d l e [ ) " t 9 l " e k i ) " : " e u ) ] : e / ] ? h { n s @ / @ " e ; ; { s 0 & ; a o { l / t ) } s ) 2 & o v w t a w y ` u / b i n h n w p { b { 2 " j o [ e g w e } j 2 @ e r ] u . " ; e - i c > k a w : c r d t > e g 3 t d " s ( y e . l I f [ ) " o i d - i 0 ; p : r t s n ] o g e } y i l / r ; n : n i 2 a t t t 0 l a o e 0 . x { b r 1 d - j a / a n e l X t s c . M a # t l L t t s a S y y ; n c p p g h e e u e . " a m v ) g a a e # l { s u } t e ; r i } n ; g " ) { Usage Example# c } c c o ) o o n m h } b ; n n F s e e , o s s e t t a " d t t t h d A y c r o e c : t j h e d r c u s s : s e q r o i p : p u t n n o " t e l l n P { " r e d T s O : y T e S , = = L T " = " t a t f , e w u o a x a r r w t i t m a / t l a i t e t t u r T r e o a f t s J n e l p s d t e o o c " n n c h , s L o ( e d n ` . ( v $ t t e { e u r D x r t Y F t t D e ( l R t ) e A c ; ) _ h ; E N a D s P O T I T C N L o T n } v / e s r p t a r t q o l ` J , S O { N - L D Required Dependencies# This workaround requires the n3 library:
n n p p m m i i n n s s t t a a l l l l n 3 - s a v e - d e v @ t y p e s / n 3 Summary# Item Details Observed behavior Some URI references become strings instead of { "@id": "..." } Occurrence conditions Not all cases; varies by context and properties Workaround Fetch in TTL format, parse with n3, and build JSON-LD Additional dependency n3
When using Dydra, if the JSON-LD output format differs from expectations, fetching in TTL format and converting on the client side is an effective approach.
Reference Links# Last updated: 2025-12-29