Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
WinFS
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Data retrieval== [[Image:WinFSFlowChart.svg|thumb|Flowchart for creating, searching and updating WinFS data instances]] The primary mode of data retrieval from a WinFS store is querying the WinFS store according to some criteria,<ref name="WinFSFiles" /> which returns an [[enumerable]] set of items matching the criteria. The criteria for the query is specified using the [[#OPath|OPath]] [[query language]]. The returned data are made available as instances of the type schemas, conforming to the [[Microsoft .NET|.NET]] [[Object-oriented programming|object model]].<ref>{{cite web | url = http://blogs.msdn.com/winfs/archive/2005/11/18/494707.aspx | title = Unify, Organize, Explore, and Innovate. Oh my! (Part 4) | author = Vijay Bangaru | publisher = WinFS Team Blog | access-date = 2007-06-30 | archive-url = https://web.archive.org/web/20070618154258/http://blogs.msdn.com/winfs/archive/2005/11/18/494707.aspx | archive-date = 2007-06-18 | url-status = dead }}</ref> The data in them can be accessed by accessing the properties of individual objects.<ref name="Dev2" /> Relations are also exposed as properties. Each WinFS Item has two properties, named ''IncomingRelationships'' and ''OutgoingRelationships'', which provide access to the set of relationship instances the item participates in. The other item which participates in one relationship instance can be reached through the proper relationship instance.<ref name="DotNetShow" /><ref name="Dev2" /> The fact that the data can be accessed using its description, rather than location, can be used to provide end-user organizational capabilities without limiting to the hierarchical organization as used in file-systems. In a file system, each file or folder is contained in only one folder. But WinFS Items can participate in any number of holding relationships, that too with any other items. As such, end users are not limited to only file/folder organization. Rather, a contact can become a container for documents; a picture a container for contacts and so on. For legacy compatibility, WinFS includes a pseudo-type called ''Folder,'' which is present only to participate in holding relationships and emulate file/folder organization. Since any WinFS Item can be related with more than one Folder item, from an end user perspective, an item can reside in multiple folders without duplicating the actual data.<ref name="DotNetShow" /> Applications can also analyze the relationship [[Graph (data structure)|graphs]] to present various filters. For example, an email application can analyze the related contacts and the relationships of the contacts with restaurant bills and dynamically generate filters like ''"Emails sent to people I had lunch with"''. ===Searches=== The WinFS API provides a class called the ''ItemContext'' class, which is bound to a WinFS store. The ''ItemContext'' object can be used to scope the search to the entire store or a subset of it. It also provides [[Transaction (database)|transactional]] access to the store.<ref name="ForDev" /> An object of this class can then spawn an ''ItemSearcher'' object which then takes the type (an object representing the type) of the item to be retrieved or the relationship and the [[#OPath|OPath]] [[Query language|query]] string representing the criteria for the search.<ref name="Dev2" /><ref name="OPath">{{cite web | url = http://msdn2.microsoft.com/en-us/library/aa480689.aspx | title = An Introduction to "WinFS" OPath | date = October 18, 2004 | access-date = 2007-06-30 | author = Thomas Rizzo, Sean Grimaldi | work = MSDN | publisher = Microsoft }}</ref> A set of all matches is returned, which can then be bound to a UI widget for displaying ''en masse'' or enumerating individually.<ref name="MSDNMag" /> The properties items can also be modified and then stored back to the data store to update the data. The ItemContext object is ''closed'' (which marks the end of association of the object with the store) when the queries are made or changes merged into the store. Related items can also be accessed through the items. The ''IncomingRelationships'' and ''OutgoingRelationships'' properties give access to all the set of relationship instances, typed to the name of the relationship. These relationship objects expose the other item via a property. So, for example, if a picture is related to a picture, it can be accessed by ''traversing'' the relationship as: <syntaxhighlight lang="csharp"> ContactsCollection contacts = picture.OutgoingRelationships.Cast(typeof(Contact)).Value; // This retrieves the collection of all outgoing relationships from a picture object // and filters down the contacts reachable from them and retrieves its value. // Or the relationship can be statically specified as ContactsCollection contacts = picture.OutgoingRelationships.OutContactRelationship.Contact; </syntaxhighlight> {{anchor|OPath}} An OPath query string allows to express the parameters that will be queried for to be specified using ''[[#Data storage|Item]]'' properties, embedded ''Items'' as well as ''[[#Data storage|Relationships]]''.{{citation needed|date=January 2015}} It can specify a single search condition, such as ''"title = Something'"'', or a compound condition such as ''"title = 'Title 1' || title = 'Title 2' && author = 'Someone'"''. These Boolean and relational operations can be specified using [[C Sharp (programming language)|C#]] like ''&&'', ''||'', ''='', ''!='' operators as well as their English-like equivalent like ''EQUAL'', ''NOT EQUAL''. [[SQL]] like operators such as ''LIKE'', ''GROUP BY'' and ''ORDER BY'' are also supported, as are wildcard conditions.{{citation needed|date=January 2015}} So, ''"title LIKE 'any*'"'' is a valid query string. These operators can be used to execute complex searches such as <syntaxhighlight lang="csharp"> using (ItemContext ic = ItemContext.Open()) { // Searching begins by creating a ItemSearcher object. The searcher is created from a // relationship instance because the contacts being searched for are in relation. The // first parameter defines the scope of the search. An ItemContext as the scope means // the entire store is to be searched. Scope can be limited to a set of Items which may // be in a holding relationship with the contacts. In that case, the set is passed as // the scope of the search. ItemSearcher searcher = OutContactRelationship.GetTargetSearcher(ic, typeof(Contact)); ContactCollection contacts = searcher.FindAll("OutContactRelationship.Contact.Name LIKE 'A*'"); } </syntaxhighlight> The above code snippet creates an ItemSearcher object that searches on the ''OutContactRelationship'' instance that relates pictures and contacts, in effect searching all pictures related with a contact. It then runs the query ''Name LIKE 'A*'"'' on all contacts reachable through ''OutContactRelationship'', returning the list of ''"contacts whose names start with A and whose pictures I have"''. Similarly, more relationships could be taken into account to further narrow down the results.<ref name="DotNetShow" /><ref name="Dev2" /> Further, a natural language query processor, which parses query in natural language and creates a well-formed OPath query string to search via proper relationships, can allow users to make searches such as ''"find the name of the wine I had with person X last month"'', provided financial management applications are using WinFS to store bills. Different relations specify a different set of data. So when a search is made that encompasses multiple relations, the different sets of data are retrieved individually and a [[Relational algebra|union]] of the different sets is computed. The resulting set contains only those data items that correspond to all the relations.<ref name="Dev2" /> ===Notifications=== WinFS includes better support for handling data that changes frequently. Using WinFS ''Notifications'', applications choose to be notified of changes to selected data ''Items''. WinFS will raise an ''ItemChangedEvent'', using the .NET Event model, when a subscribed-to Item changes, and the event will be published to the applications.<ref name="Dev2" /> ===Information Agent=== WinFS includes an Information Agent feature for the management, retrieval, and storage of end-user notification rules and preferences for changes to items in the data store. Using Information Agent, it is possible to automatically define relations to new items based on events such as appointments, with an example being that appointments can be related to photos based on the dates the photos were taken, enabling queries for birthdays or holidays without needing to know the actual dates of such events ("''find all photos taken on this birthday''"). Other examples include automatically moving new items to specific folders based on a rule as determined by appointment times and dates the photos were taken ("''when I import a photo taken during a business event, move it to the Business Events folder''") or more complex possibilities. Information Agent can also forward notifications to other devices ("''if I receive a high priority email from my boss, send a notification to my phone''") and is similar to Rules and Alerts functionality of Microsoft Outlook.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)