json verilerin içerisinden, ilgi nesnenin ilgili propertisinde arama yapmak

84 views
Skip to first unread message

Bayram Akbuz

unread,
May 25, 2012, 10:19:26 AM5/25/12
to altdotne...@googlegroups.com
Arkadaşlar, tek bir alanda json nesnesi olarak tuttuğum bir takım veriler var. 

Bu verilerin içerisinden ilgili nesnenin ilgili öğesini hızlı bir şekilde çıkartacak bir linq veya sql sorgusu nasıl olmalı?

Örneğin roma için sadece Tags olarak belirttiğim nesnenin Slug propertisinde arayacak ama Locations veya başka bir nesne içerisinde arama yapmayacak. 

Bütün kayıtları tümünü çekip json verileri çevirmem söz konusu değil.

Geçici olarak şöyle çözüm ürettim => "Slug":"roma"


örnek json verileri:

{"Locations":[{"CountryId":"5198","CountryName":"Japonya","CityId":"5284","CityName":"Tokyo"}],"Tags":[{"TermId":24,"Name":"Roma","Slug":"roma"}]}
{"Locations":[{"CountryId":"5068","CountryName":"İtalya","CityId":"768","CityName":"Roma"}]}
{"Locations":[{"CountryId":"1056","CountryName":"Brezilya","CityId":"1413","CityName":"Rio De Janeiro"}]}
{"Locations":[{"CountryId":"8090","CountryName":"Amerika","CityId":"9406","CityName":"New York"}]}


teşekkürler.

emre eren

unread,
May 25, 2012, 1:21:40 PM5/25/12
to altdotne...@googlegroups.com
Bana daha iyi bir çözüm yok gibi geldi ama inşallah Slug içinde Roma geçenleri aratmak zorunda kalmazsın ;) JSON içinden SQL ile veri çekmek de enteresan bir durum aslında.

25 Mayıs 2012 Cuma 17:19:26 UTC+3 tarihinde Bayram Akbuz yazdı:

Bayram Akbuz

unread,
May 25, 2012, 1:24:33 PM5/25/12
to altdotne...@googlegroups.com
çok-a-çok ilişki kurmak yerine verileri json ile tutmak daha kolay idi, etiket kullanımı çok fazla göz önünde olan bir yer değil. şu an için geçici bir çözüm olarak böyle yaptım. daha mantıklısı nasıl olmalıdır?

emre eren

unread,
May 26, 2012, 6:33:07 AM5/26/12
to altdotne...@googlegroups.com
Bayram selamlar. Bu konu Entity-Attribute-Value Model diye geçiyor. Relational Database dünyasında bu konuda standart bir çözüm malesef yok. Mevcut çözümlerden ihtiyaçlarına uygun bir tanesini tercih etmek ya da kullandığın sunucu uygulamasına özel çözümler varsa bunları tercih etmek durumundasın. Eğer veriyi JSON formatında tutmak ihtiyacını çözüyorsa bence böyle kalabilir.

Daha fazla bilgi için şu dökümana bir göz at istersen. http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model 

25 Mayıs 2012 Cuma 20:24:33 UTC+3 tarihinde Bayram Akbuz yazdı:

Bayram Akbuz

unread,
May 26, 2012, 12:05:13 PM5/26/12
to altdotne...@googlegroups.com
teşekkürler. 

Gokhan Demir

unread,
May 26, 2012, 7:14:14 PM5/26/12
to altdotne...@googlegroups.com
elastic search yada solr ile json datani indexleyip, sorgulayabilirsin. rdbms ile json datayi sorgulamak cok verimli olmucaktir.

On Sat, May 26, 2012 at 7:05 PM, Bayram Akbuz <bayram...@gmail.com> wrote:
teşekkürler. 

--
You received this message because you are subscribed to the Google Groups "altdotnetturkiye" group.
To view this discussion on the web visit https://groups.google.com/d/msg/altdotnetturkiye/-/S2iAT74VhSAJ.

To post to this group, send email to altdotne...@googlegroups.com.
To unsubscribe from this group, send email to altdotnetturki...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/altdotnetturkiye?hl=en.



--
Gokhan Demir.

Bayram Akbuz

unread,
May 27, 2012, 4:37:14 AM5/27/12
to altdotne...@googlegroups.com
bununla ilgili herhangi bir makale vb. var mı? bir kaç tane aratıp buldum ama bahsettiğiniz teknikler mi emin değilim.

Tolga Yıkılmaz

unread,
May 27, 2012, 6:48:30 AM5/27/12
to altdotne...@googlegroups.com
Newtonsoft.Json incelersen işine yarar bişeyler çıkabilir.

2012/5/27 Bayram Akbuz <bayram...@gmail.com>
bununla ilgili herhangi bir makale vb. var mı? bir kaç tane aratıp buldum ama bahsettiğiniz teknikler mi emin değilim.

--
You received this message because you are subscribed to the Google Groups "altdotnetturkiye" group.
To view this discussion on the web visit https://groups.google.com/d/msg/altdotnetturkiye/-/q2C1MNd-xxMJ.
Reply all
Reply to author
Forward
0 new messages